Merge pull request #29 from rcoemans/patch-9

Update restore.sh
pull/30/head
Darren Kitchen 2020-08-21 10:41:06 -07:00 committed by GitHub
commit 73013b1c83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -59,17 +59,17 @@ PUSHOVER_DEVICE="{your-device}" # Multiple devices may be separated by a comma
# ****************************************************************************************************
function CHECK_INPUT_PARAM() {
if [ "$1" == "" ]; then
echo "Please specify the backup.zip file to be restored (e.g. "bash ./restore.sh /tmp/1-20200101-SharkJack-backup.zip")."
if [ $# -lt 1 ]; then
echo "Please specify the backup.zip file to be restored (e.g. "bash $0 /tmp/1-20200101-SharkJack-backup.zip")."
exit
elif [ ! -f "$1" ]; then
echo "$1 is not an existing file, please specify a backup.zip file to be restored (e.g. "bash ./restore.sh /tmp/1-20200101-SharkJack-backup.zip")."
echo "$1 is not an existing file, please specify a backup.zip file to be restored (e.g. "bash $0 /tmp/1-20200101-SharkJack-backup.zip")."
exit
elif [ "${1##*.}" == "zip" ]; then
BACKUP_FILENAME=$(basename $1)
BACKUP_FILENAME=${BACKUP_FILENAME%.*}
else
echo "$1 is not an zip file, please specify a backup.zip file to be restored (e.g. "bash ./restore.sh /tmp/1-20200101-SharkJack-backup.zip")."
echo "$1 is not an zip file, please specify a backup.zip file to be restored (e.g. "bash $0 /tmp/1-20200101-SharkJack-backup.zip")."
exit
fi
return