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 shift
value=$* value=$*
eval "${var}=\${$var:-$value}" eval "$var=\${$var-\$value}"
export "${var?}"
export "$var"
} #=> set_var() } #=> set_var()
@@ -548,7 +547,7 @@ set_list() {
eval "$list=\"$value\"" eval "$list=\"$value\""
fi fi
export "$list" export "${list?}"
} #=> set_list() } #=> set_list()
@@ -1396,11 +1395,9 @@ _check_cert() {
_log "Enter the function '_check_cert()'..." 1 _log "Enter the function '_check_cert()'..." 1
# Verify FQHN # Verify FQHN
_Hostname "check" "hostname" if ! Hostname check hostname; then
log "The provided hostname $DYNTLS_MEMBER_HOSTNAME is not a valid FQHN. Aborting check." 3
if [ "$?" -ne 0 ]; then log "Leave the function checkcert..." 1
_log "The provided hostname '$DYNTLS_MEMBER_HOSTNAME' is not a valid FQHN. Aborting check." 3
_log "Leave the function '_check_cert()'..." 1
exit 1 exit 1
fi fi
@@ -1437,9 +1434,7 @@ _remove_cert() {
_log "Enter the function '_remove_cert()'..." 1 _log "Enter the function '_remove_cert()'..." 1
# Verify FQHN # Verify FQHN
_Hostname "check" "hostname" if ! Hostname check hostname; then
if [ "$?" -ne 0 ]; then
_log "The provided hostname '$DYNTLS_MEMBER_HOSTNAME' is not a valid FQHN. Cannot proceed." 3 _log "The provided hostname '$DYNTLS_MEMBER_HOSTNAME' is not a valid FQHN. Cannot proceed." 3
_log "Leave the function '_remove_cert()'..." 1 _log "Leave the function '_remove_cert()'..." 1
@@ -1447,8 +1442,7 @@ _remove_cert() {
fi fi
# Check HostnameDB # Check HostnameDB
_HostnameDB "check" if HostnameDB check; then
if [ "$?" -eq 0 ]; then
# Remove hostname # Remove hostname
_log "Hostname '$DYNTLS_MEMBER_HOSTNAME' found. Removing from HostnameDB..." 1 _log "Hostname '$DYNTLS_MEMBER_HOSTNAME' found. Removing from HostnameDB..." 1