Fixed destroyjails so it can destroy multiple jails. Minor formatting cleanup around usage code.

This commit is contained in:
Thorsten Behrens 2020-04-06 22:27:24 -04:00 committed by kjeld Schouten-Lebbing
parent 77f1589701
commit 3193319d2c

View File

@ -46,13 +46,13 @@ while getopts ":i:r:u:d:g:h" opt
;; ;;
u ) updatejails=("$OPTARG") u ) updatejails=("$OPTARG")
until [[ $(eval "echo \${$OPTIND}") =~ ^-.* ]] || [ -z $(eval "echo \${$OPTIND}") ]; do until [[ $(eval "echo \${$OPTIND}") =~ ^-.* ]] || [ -z $(eval "echo \${$OPTIND}") ]; do
updateljails+=($(eval "echo \${$OPTIND}")) updatejails+=($(eval "echo \${$OPTIND}"))
OPTIND=$((OPTIND + 1)) OPTIND=$((OPTIND + 1))
done done
;; ;;
d ) destroyjails=("$OPTARG") d ) destroyjails=("$OPTARG")
until [[ $(eval "echo \${$OPTIND}") =~ ^-.* ]] || [ -z $(eval "echo \${$OPTIND}") ]; do until [[ $(eval "echo \${$OPTIND}") =~ ^-.* ]] || [ -z $(eval "echo \${$OPTIND}") ]; do
deletejails+=($(eval "echo \${$OPTIND}")) destroyjails+=($(eval "echo \${$OPTIND}"))
OPTIND=$((OPTIND + 1)) OPTIND=$((OPTIND + 1))
done done
;; ;;