Fix unbound variable errors

This commit is contained in:
2022-06-02 16:08:07 +02:00
parent a6eeccb417
commit 4f8c1b5388
15 changed files with 85 additions and 86 deletions

View File

@@ -73,7 +73,7 @@ step_2() {
addConf -a "$v3AuthEntry" "$v3AuthLoc"
shift
if [ ! -z $1 ] && [ "$1" == "-s" ] ; then
if [ -n "${1:-}" ] && [ "$1" == "-s" ] ; then
info "Stop after creating authentication config"
exe service snmpd start
return 0
@@ -109,7 +109,7 @@ step_5_alias() { echo "ufw"; }
step_5() {
shift
local lInterface="eth0"
[ ! -z "$1" ] && lInterface="$1"
[ -n "${1:-}" ] && lInterface="$1"
# Check if interface exists
ip -br a | grep -E "^$lInterface" >>/dev/null 2>&1
endReturn -o $? "Interface $lInterface does not exist"