]> git.p6c8.net - nextcloud-backup-restore.git/commitdiff
Parameter handling
authorDecaTec <jr@decatec.de>
Tue, 22 Jan 2019 08:47:41 +0000 (09:47 +0100)
committerDecaTec <jr@decatec.de>
Tue, 22 Jan 2019 08:47:41 +0000 (09:47 +0100)
NextcloudRestore.sh

index fabd463acbe9ac2fd761b6ea71a4a58a842d5c71..1669a181d3925943dbaba40930ab6173186e2841 100644 (file)
@@ -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

patrick-canterino.de