mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-23 03:02:32 +01:00
rdiff: add extra sanity check for keep parameter
This commit is contained in:
parent
db7daa3d59
commit
e017810941
@ -159,6 +159,11 @@ case $desttype in
|
||||
* ) fatal "desttype '$desttype' is neither local nor remote" ;;
|
||||
esac
|
||||
|
||||
# check keep parameter format
|
||||
if [ "$keep" != "yes" ] && ! echo "$keep" | grep -qe '^[0-9]\+[smhDWMY]\?$'; then
|
||||
fatal "Keep parameter contains an invalid value ($keep)."
|
||||
fi
|
||||
|
||||
### REMOVE OLD BACKUPS ###
|
||||
|
||||
if [ "$keep" != yes ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user