mirror of
https://github.com/donl/vzpbackup.git
synced 2026-05-26 14:22:18 -06:00
only accept yes or no for --suspend
This commit is contained in:
parent
ec038625f7
commit
2846a39bbb
1 changed files with 4 additions and 3 deletions
|
|
@ -7,10 +7,12 @@ KEEP_COUNT=0
|
|||
SUSPEND="no"
|
||||
FULL_BACKUP="no"
|
||||
INC_BACKUP="no"
|
||||
VZCTL_PARAM=""
|
||||
|
||||
# COMMANDLINE PARSING
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
for param in "$@"; do
|
||||
case $param in
|
||||
-h|--help)
|
||||
|
|
@ -27,8 +29,9 @@ for param in "$@"; do
|
|||
--keep-count=+([0-9]))
|
||||
KEEP_COUNT=${param#*=}
|
||||
;;
|
||||
--suspend=*)
|
||||
--suspend=+(yes|no))
|
||||
SUSPEND=${param#*=}
|
||||
test "$SUSPEND" = "yes" || VZCTL_PARAM="$VZCTL_PARAM --skip-suspend"
|
||||
;;
|
||||
--full)
|
||||
FULL_BACKUP="yes"
|
||||
|
|
@ -40,8 +43,6 @@ for param in "$@"; do
|
|||
done
|
||||
shopt -u extglob
|
||||
|
||||
test "$SUSPEND" -eq "yes" && SUSPEND="" || SUSPEND="--skip-suspend"
|
||||
|
||||
# make sure we only run once
|
||||
test -f /var/run/vzbackup.pid && exit 0
|
||||
touch /var/run/vzbackup.pid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue