From 95acb367ebc1a81b2edbe531d74f11bb59393f1a Mon Sep 17 00:00:00 2001 From: DecaTec Date: Fri, 5 Nov 2021 16:59:19 +0100 Subject: [PATCH] Bugfix: Unbound variable when no parameters are supplied --- CHANGELOG.md | 5 +++++ NextcloudBackup.sh | 4 ++-- NextcloudRestore.sh | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57dfe21..e872ba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2.3.1 + +### General +- Bugfix: Unbound variable when no parameters are supplied + ## 2.3.0 ### General diff --git a/NextcloudBackup.sh b/NextcloudBackup.sh index f719087..8d8149c 100644 --- a/NextcloudBackup.sh +++ b/NextcloudBackup.sh @@ -3,7 +3,7 @@ # # Bash script for creating backups of Nextcloud. # -# Version 2.3.0 +# Version 2.3.1 # # Requirements: # - pigz (https://zlib.net/pigz/) for using backup compression. If not available, you can use another compression algorithm (e.g. gzip) @@ -29,7 +29,7 @@ set -Eeuo pipefail # Variables -backupMainDir=$1 +backupMainDir=${1:-} if [ -z "$backupMainDir" ]; then # TODO: The directory where you store the Nextcloud backups (when not specified by args) diff --git a/NextcloudRestore.sh b/NextcloudRestore.sh index a18ecd0..60825b8 100644 --- a/NextcloudRestore.sh +++ b/NextcloudRestore.sh @@ -3,7 +3,7 @@ # # Bash script for restoring backups of Nextcloud. # -# Version 2.3.0 +# Version 2.3.1 # # Requirements: # - pigz (https://zlib.net/pigz/) for using backup compression. If not available, you can use another compression algorithm (e.g. gzip) @@ -29,8 +29,8 @@ set -Eeuo pipefail # Variables -restore=$1 -backupMainDir=$2 +restore=${1:-} +backupMainDir=${2:-} if [ -z "$backupMainDir" ]; then # TODO: The directory where you store the Nextcloud backups (when not specified by args) -- 2.34.1