fix: address ShellCheck findings SC2163 and SC2181

This commit is contained in:
2026-06-27 14:28:29 +02:00
parent 419d820f58
commit dc687d5d8e
+8 -14
View File
@@ -520,9 +520,8 @@ set_var() {
shift
value=$*
eval "${var}=\${$var:-$value}"
export "$var"
eval "$var=\${$var-\$value}"
export "${var?}"
} #=> set_var()
@@ -548,7 +547,7 @@ set_list() {
eval "$list=\"$value\""
fi
export "$list"
export "${list?}"
} #=> set_list()
@@ -1396,11 +1395,9 @@ _check_cert() {
_log "Enter the function '_check_cert()'..." 1
# Verify FQHN
_Hostname "check" "hostname"
if [ "$?" -ne 0 ]; then
_log "The provided hostname '$DYNTLS_MEMBER_HOSTNAME' is not a valid FQHN. Aborting check." 3
_log "Leave the function '_check_cert()'..." 1
if ! Hostname check hostname; then
log "The provided hostname $DYNTLS_MEMBER_HOSTNAME is not a valid FQHN. Aborting check." 3
log "Leave the function checkcert..." 1
exit 1
fi
@@ -1437,9 +1434,7 @@ _remove_cert() {
_log "Enter the function '_remove_cert()'..." 1
# Verify FQHN
_Hostname "check" "hostname"
if [ "$?" -ne 0 ]; then
if ! Hostname check hostname; then
_log "The provided hostname '$DYNTLS_MEMBER_HOSTNAME' is not a valid FQHN. Cannot proceed." 3
_log "Leave the function '_remove_cert()'..." 1
@@ -1447,8 +1442,7 @@ _remove_cert() {
fi
# Check HostnameDB
_HostnameDB "check"
if [ "$?" -eq 0 ]; then
if HostnameDB check; then
# Remove hostname
_log "Hostname '$DYNTLS_MEMBER_HOSTNAME' found. Removing from HostnameDB..." 1