style: refine dyndns.sh and vars.example comments and formatting
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
# - Validate database connectivity before command execution
|
# - Validate database connectivity before command execution
|
||||||
# - POSIX-compatible operation for cron and service integration
|
# - POSIX-compatible operation for cron and service integration
|
||||||
|
|
||||||
# Authors: Stephan Düsterhaupt
|
# Authors: Stephan Düsterhaupt, Ivo Noack aka Insonic
|
||||||
# Copyright (c) 2018-2026 CB-601 - the open tec Elevator
|
# Copyright (c) 2018-2026 CB-601 - the open tec Elevator
|
||||||
# License: MIT
|
# License: MIT
|
||||||
|
|
||||||
@@ -233,10 +233,10 @@ _vars_source_check() {
|
|||||||
[ -n "$DYNDNS_SQL_USER" ] || _die "DYNDNS_SQL_USER env-var undefined" 5
|
[ -n "$DYNDNS_SQL_USER" ] || _die "DYNDNS_SQL_USER env-var undefined" 5
|
||||||
[ -n "$DYNDNS_SQL_PASS" ] || _die "DYNDNS_SQL_PASS env-var undefined" 5
|
[ -n "$DYNDNS_SQL_PASS" ] || _die "DYNDNS_SQL_PASS env-var undefined" 5
|
||||||
|
|
||||||
[ -n "$DYNDNS_BIND_ZONE" ] || _die "DYNDNS_BIND_ZONE env-var undefined" 5
|
[ -n "$DYNDNS_BIND_ZONE" ] || _die "DYNDNS_BIND_ZONE env-var undefined" 5
|
||||||
[ -n "$DYNDNS_BIND_ZONE_KEY" ] || _die "DYNDNS_BIND_ZONE_KEY env-var undefined" 5
|
[ -n "$DYNDNS_BIND_ZONE_KEY" ] || _die "DYNDNS_BIND_ZONE_KEY env-var undefined" 5
|
||||||
[ -n "$DYNDNS_BIND_ZONE_DIR" ] || _die "DYNDNS_BIND_ZONE_DIR env-var undefined" 5
|
[ -n "$DYNDNS_BIND_ZONE_DIR" ] || _die "DYNDNS_BIND_ZONE_DIR env-var undefined" 5
|
||||||
[ -n "$DYNDNS_BIND_ZONE_FILE" ] || _die "DYNDNS_BIND_ZONE_FILE env-var undefined" 5
|
[ -n "$DYNDNS_BIND_ZONE_FILE" ] || _die "DYNDNS_BIND_ZONE_FILE env-var undefined" 5
|
||||||
|
|
||||||
_log "Leave the function '_vars_source_check()'..." 1
|
_log "Leave the function '_vars_source_check()'..." 1
|
||||||
|
|
||||||
@@ -253,8 +253,8 @@ _verify_runtime_init() {
|
|||||||
|
|
||||||
_vars_source_check
|
_vars_source_check
|
||||||
|
|
||||||
[ -d "$DYNDNS_LOG_DIR" ] || _die "DYNDNS_LOG_DIR missing. $help_note" 5
|
[ -d "$DYNDNS_LOG_DIR" ] || _die "DYNDNS_LOG_DIR missing. $help_note" 5
|
||||||
[ -d "$DYNDNS_BIND_ZONE_DIR" ] || _die "DYNDNS_BIND_ZONE_DIR missing. $help_note" 5
|
[ -d "$DYNDNS_BIND_ZONE_DIR" ] || _die "DYNDNS_BIND_ZONE_DIR missing. $help_note" 5
|
||||||
|
|
||||||
#[ -f "$DYNDNS_BIND_ZONE_FILE" ] || _die "DYNDNS_BIND_ZONE_FILE missing. $help_note" 5
|
#[ -f "$DYNDNS_BIND_ZONE_FILE" ] || _die "DYNDNS_BIND_ZONE_FILE missing. $help_note" 5
|
||||||
|
|
||||||
@@ -398,17 +398,17 @@ set_var() {
|
|||||||
|
|
||||||
|
|
||||||
# SDuesterhaupt: 2026-06-18 - Write a message to the dynDNS log file.
|
# SDuesterhaupt: 2026-06-18 - Write a message to the dynDNS log file.
|
||||||
|
#
|
||||||
# Severity levels:
|
# Severity levels:
|
||||||
# 0 -> OFF
|
# 0 -> OFF
|
||||||
# 1 -> DEBUG
|
# 1 -> DEBUG
|
||||||
# 2 -> INFO
|
# 2 -> INFO
|
||||||
# 3 -> WARNING
|
# 3 -> WARNING
|
||||||
# 4 -> ERROR
|
# 4 -> ERROR
|
||||||
# 5 -> CRITICAL
|
# 5 -> CRITICAL
|
||||||
|
#
|
||||||
# @param1: Log message.
|
# @param1: Log message.
|
||||||
# @param2: Severity level.
|
# @param2: Severity level.
|
||||||
_log() {
|
_log() {
|
||||||
msg=$1
|
msg=$1
|
||||||
level=${2:-0}
|
level=${2:-0}
|
||||||
@@ -444,10 +444,10 @@ _log() {
|
|||||||
|
|
||||||
|
|
||||||
# SDuesterhaupt: 2026-06-18 - Check whether DYNDNS_MEMBER_HOSTNAME is a valid hostname
|
# SDuesterhaupt: 2026-06-18 - Check whether DYNDNS_MEMBER_HOSTNAME is a valid hostname
|
||||||
|
#
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0 if valid
|
# 0 if valid
|
||||||
# 1 if invalid
|
# 1 if invalid
|
||||||
_hostname_is_valid() {
|
_hostname_is_valid() {
|
||||||
_log "Enter the function '_hostname_is_valid()'..." 1
|
_log "Enter the function '_hostname_is_valid()'..." 1
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -69,7 +69,7 @@
|
|||||||
# Database login credentials.
|
# Database login credentials.
|
||||||
# These are mainly used when DYNDNS_SQL_GROUP is unset/empty.
|
# These are mainly used when DYNDNS_SQL_GROUP is unset/empty.
|
||||||
#set_var DYNDNS_SQL_USER "dyndns_user"
|
#set_var DYNDNS_SQL_USER "dyndns_user"
|
||||||
#set_var DYNDNS_SQL_PASS "strong_passphrase"
|
#set_var DYNDNS_SQL_PASS "<REPLACE_WITH_STRONG_PASSWORD>"
|
||||||
|
|
||||||
# Additional database client options, if needed.
|
# Additional database client options, if needed.
|
||||||
# Example:
|
# Example:
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
#set_var DYNDNS_MEMBER_EMAIL "admin@example24.com"
|
#set_var DYNDNS_MEMBER_EMAIL "admin@example24.com"
|
||||||
|
|
||||||
# Password or shared secret used during member creation/authentication
|
# Password or shared secret used during member creation/authentication
|
||||||
#set_var DYNDNS_MEMBER_PASS "strong_passphrase"
|
#set_var DYNDNS_MEMBER_PASS "<REPLACE_WITH_STRONG_PASSWORD>"
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# OPTIONAL COMMAND HOOKS
|
# OPTIONAL COMMAND HOOKS
|
||||||
|
|||||||
Reference in New Issue
Block a user