manpage: update rename section; beadm: additional checks for arguments;

This commit is contained in:
Slawomir Wojciech Wojtczak (vermaden) 2012-05-15 07:21:12 +02:00
parent 3664586858
commit e3f47a5bc6
2 changed files with 18 additions and 1 deletions

17
beadm
View File

@ -201,6 +201,10 @@ case ${1} in
;; ;;
(activate) # ---------------------------------------------------------------- (activate) # ----------------------------------------------------------------
if [ ${#} -ne 2 ]
then
__usage
fi
__be_exist ${POOL}/ROOT/${2} __be_exist ${POOL}/ROOT/${2}
if [ "${BOOTFS}" = "${POOL}/ROOT/${2}" ] if [ "${BOOTFS}" = "${POOL}/ROOT/${2}" ]
then then
@ -273,6 +277,10 @@ EOF
;; ;;
(destroy) # ---------------------------------------------------------------- (destroy) # ----------------------------------------------------------------
if [ ${#} -ne 2 ]
then
__usage
fi
__be_exist ${POOL}/ROOT/${2} __be_exist ${POOL}/ROOT/${2}
if [ "${BOOTFS}" = "${POOL}/ROOT/${2}" ] if [ "${BOOTFS}" = "${POOL}/ROOT/${2}" ]
then then
@ -321,7 +329,16 @@ EOF
;; ;;
(rename) # ------------------------------------------------------------------ (rename) # ------------------------------------------------------------------
if [ ${#} -ne 2 ]
then
__usage
fi
__be_exist ${POOL}/ROOT/${2} __be_exist ${POOL}/ROOT/${2}
if [ "${BOOTFS}" = "${POOL}/ROOT/${2}" ]
then
echo "ERROR: Renaming the active BE is not supported"
exit 1
fi
if zfs list -H -o name ${POOL}/ROOT/${3} 2> /dev/null if zfs list -H -o name ${POOL}/ROOT/${3} 2> /dev/null
then then
echo "ERROR: Boot environment '${3}' already exists" echo "ERROR: Boot environment '${3}' already exists"

View File

@ -94,7 +94,7 @@ Displays all boot environments.
.Pp .Pp
.It Ic rename Ao Ar origBeName Ac Ao Ar newBeName Ac .It Ic rename Ao Ar origBeName Ac Ao Ar newBeName Ac
.Pp .Pp
Renames the given Renames the given nonactive
.Ar origBeName .Ar origBeName
to the given to the given
.Ar newBeName .Ar newBeName