Minor (destroy) fixes.
This commit is contained in:
parent
d94213443d
commit
3701f893d5
7
beadm
7
beadm
|
|
@ -28,7 +28,7 @@ PATH=${PATH}:/bin:/usr/bin:/sbin:/usr/sbin
|
|||
|
||||
if [ $( uname -r | cut -d '.' -f1 ) -lt 8 ]
|
||||
then
|
||||
echo "ERROR: beadm only works on FreeBSD 8.0 or later."
|
||||
echo "ERROR: beadm only works on FreeBSD 8.0 or later"
|
||||
fi
|
||||
|
||||
__usage() {
|
||||
|
|
@ -276,7 +276,7 @@ EOF
|
|||
fi
|
||||
else
|
||||
ORIGINS=$( zfs list -r -H -o origin ${POOL}/ROOT/${2} )
|
||||
if zfs destroy ${POOL}/ROOT/${2} 1> /dev/null 2> /dev/null
|
||||
if ! zfs destroy ${POOL}/ROOT/${2} 1> /dev/null 2> /dev/null
|
||||
then
|
||||
zfs destroy -r ${POOL}/ROOT/${2} 2>&1 \
|
||||
| grep "${POOL}/ROOT/" \
|
||||
|
|
@ -286,12 +286,15 @@ EOF
|
|||
zfs promote ${I} 2> /dev/null
|
||||
done
|
||||
fi
|
||||
if ! [ "${ORIGINS}" = "-" ]
|
||||
then
|
||||
echo "${ORIGINS}" \
|
||||
| while read I
|
||||
do
|
||||
zfs destroy -r ${I} 2> /dev/null
|
||||
done
|
||||
fi
|
||||
fi
|
||||
echo "Destroyed successfully"
|
||||
;;
|
||||
(*)
|
||||
|
|
|
|||
Loading…
Reference in New Issue