Révision 49 bin/create-filesystem

create-filesystem (revision 49)
1 1
#!/bin/bash
2 2
# $Id$
3 3

  
4
BINZFS="/sbin/zfs"
5
BINZPOOL="/sbin/zpool"
6

  
4 7
function usage {
5 8
echo "Syntax :" 1>&2 
6 9
echo "$0 [options]" 1>&2
......
15 18

  
16 19
function nointeractive {
17 20

  
18
/sbin/zfs create -o $FS_OPTION $NAME_POOL/$NAME
21
$BINZFS create -o $FS_OPTION $NAME_POOL/$NAME
19 22

  
20 23
}
21 24

  
22 25

  
23 26
function interactive {
24
/sbin/zfs list
27
$BINZFS list
25 28
echo "*** Select the parent zpool : ***"
26 29

  
27 30
while read inputline
28 31
do
29 32
   if [ "$inputline" != "" ]
30 33
   then
31
      /sbin/zfs list |grep -i $inputline
34
      $BINZFS list |grep -i $inputline
32 35
      if [ $? -eq 1 ]
33 36
      then
34 37
         echo "*** Select the parent zpool : ***"
......
52 55
             do
53 56
                if [ "$inputFS" != "" ]
54 57
                then
55
                   /sbin/zfs list |grep -i "$inputFS "
58
                   $BINZFS list |grep -i "$inputFS "
56 59
                   if [ $? -eq 0 ]
57 60
                   then
58 61
                         echo "Filesystem name already exists"
......
65 68
                      echo "filesystem name: "
66 69
                   else
67 70
                      NAME_FS=$inputFS
68
                           /sbin/zfs create $NAME_POOL/$inputFS
71
                           $BINZFS create $NAME_POOL/$inputFS
69 72
                           if [ $? -eq 0 ]
70 73
                           then
71 74
                              echo "*** ZFS filesystem Creation [OK] ***" 
72
                              /sbin/zfs list
75
                              $BINZFS list
73 76
                              break
74 77
                           else
75 78
                              echo "/!\\ ZFS filesystem Creation [ERROR] /!\\"

Formats disponibles : Unified diff