From 63f8fde8dd02af88b2ef5de7d0776ca52acdbdac Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Wed, 13 Dec 2023 11:56:18 +0100 Subject: [PATCH] fix unbound variable error --- uberspace-backup.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/uberspace-backup.sh b/uberspace-backup.sh index 670b395..653ea85 100755 --- a/uberspace-backup.sh +++ b/uberspace-backup.sh @@ -29,8 +29,6 @@ else SSH_KEY=~/.ssh/id_rsa fi -ARG1="$1" - # Get current date DATE=$(date +"%Y-%m-%d_%H-%M") LOG="$CURDIR"/backup.log @@ -54,8 +52,8 @@ while read -r line; do RHOST=$(echo "$line" | cut -d";" -f1 | trim) - # Jump to next line if this line's host does not match host of ARG1 (if given) - if [[ "${ARG1}" != "" ]] && [[ "${ARG1}" != "${RHOST}" ]]; then + # Jump to next line if this line's host does not match host of first argument (if given) + if [[ "${1-}" != "" ]] && [[ "${1-}" != "${RHOST}" ]]; then continue fi # Task ssh-checker.sh to check this host