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