From: DecaTec Date: Tue, 22 Jan 2019 08:47:41 +0000 (+0100) Subject: Parameter handling X-Git-Tag: v1.0.0~4 X-Git-Url: https://git.p6c8.net/nextcloud-backup-restore.git/commitdiff_plain/ef1ef85ac3afd35b16f402f4c35c860c99dc72e8?ds=sidebyside;hp=-c Parameter handling --- ef1ef85ac3afd35b16f402f4c35c860c99dc72e8 diff --git a/NextcloudRestore.sh b/NextcloudRestore.sh index fabd463..1669a18 100644 --- a/NextcloudRestore.sh +++ b/NextcloudRestore.sh @@ -68,11 +68,11 @@ fileNameBackupDb="nextcloud-db.sql" errorecho() { cat <<< "$@" 1>&2; } # -# Check if parameter given +# Check if parameter(s) given # -if [ $# != "1" ] | [ $# != "2" ] +if [ $# != "1" ] && [ $# != "2" ] then - errorecho "ERROR: No backup name to restore given!" + errorecho "ERROR: No backup name to restore given, or wrong number of parameters!" errorecho "Usage: NextcloudRestore.sh 'BackupDate' ['BackupDirectory']" exit 1 fi