Révision 49 bin/del-filesystem

del-filesystem (revision 49)
1 1
#!/bin/bash
2 2
# $Id$
3
BINZFS="/sbin/zfs"
4
BINZPOOL="/sbin/zpool"
3 5

  
4 6
function usage {
5 7
  echo "Description : destroy a ZFS FileSystem." 1>&2
......
13 15

  
14 16
function nointeractive {
15 17

  
16
MOUNTED=$(zfs get -H mounted $FS_NAME|awk '{ print $3}')
18
MOUNTED=$($BINZFS get -H mounted $FS_NAME|awk '{ print $3}')
17 19

  
18 20
if [ "$MOUNTED" == "no" ]
19 21
then
20
   is_pool=$(zpool list $FS_NAME)
22
   is_pool=$($BINZPOOL list $FS_NAME)
21 23
   if [ $? == 1 ]
22 24
   then
23
      zfs destroy -r $FS_NAME
25
      $BINZFS destroy -r $FS_NAME
24 26
   else
25 27
      echo "$FS_NAME is a zpool, cannot remove recursively this filesystem" 1>&2
26 28
      exit 1;
......
35 37

  
36 38
function interactive {
37 39

  
38
zfs list
40
$BINZFS list
39 41
echo "*** Enter ZFS FileSystem Name: ***" 
40 42
while read inputline
41 43
do

Formats disponibles : Unified diff