fix unbound variable error
This commit is contained in:
@@ -29,8 +29,6 @@ else
|
|||||||
SSH_KEY=~/.ssh/id_rsa
|
SSH_KEY=~/.ssh/id_rsa
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ARG1="$1"
|
|
||||||
|
|
||||||
# Get current date
|
# Get current date
|
||||||
DATE=$(date +"%Y-%m-%d_%H-%M")
|
DATE=$(date +"%Y-%m-%d_%H-%M")
|
||||||
LOG="$CURDIR"/backup.log
|
LOG="$CURDIR"/backup.log
|
||||||
@@ -54,8 +52,8 @@ while read -r line; do
|
|||||||
|
|
||||||
RHOST=$(echo "$line" | cut -d";" -f1 | trim)
|
RHOST=$(echo "$line" | cut -d";" -f1 | trim)
|
||||||
|
|
||||||
# Jump to next line if this line's host does not match host of ARG1 (if given)
|
# Jump to next line if this line's host does not match host of first argument (if given)
|
||||||
if [[ "${ARG1}" != "" ]] && [[ "${ARG1}" != "${RHOST}" ]]; then
|
if [[ "${1-}" != "" ]] && [[ "${1-}" != "${RHOST}" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
# Task ssh-checker.sh to check this host
|
# Task ssh-checker.sh to check this host
|
||||||
|
|||||||
Reference in New Issue
Block a user