Skip to content

Commit 071be7e

Browse files
committed
backup: check for valid action before processing args
1 parent cb858af commit 071be7e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

geoip-shell-backup.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ EOF
3737

3838
#### PARSE ARGUMENTS
3939

40+
# check for valid action
4041
action="$1"
42+
case "$action" in
43+
create-backup|restore) ;;
44+
* ) unknownact
45+
esac
4146

4247
# process the rest of the args
4348
shift 1
@@ -128,7 +133,6 @@ case "$action" in
128133
restorebackup
129134
printf '%s\n\n' "Successfully restored $p_name state from backup."
130135
statustip ;;
131-
*) unknownact
132136
esac
133137

134138
die 0

0 commit comments

Comments
 (0)