🗃️ Update codebase 🗃️

rootfs/root/docker/setup/03-files.sh
rootfs/usr/local/etc/docker/init.d/02-named.sh

rootfs/usr/local/etc/docker/init.d/02-named.sh
This commit is contained in:
casjay
2025-10-31 13:27:32 -04:00
parent ec75859d6e
commit 4987e52654

View File

@@ -340,6 +340,7 @@ __pre_execute() {
# define actions to run after copying to /config # define actions to run after copying to /config
zone_files="$(find "$DATA_DIR/zones/" -type f 2>/dev/null | wc -l)" zone_files="$(find "$DATA_DIR/zones/" -type f 2>/dev/null | wc -l)"
if [ $zone_files = 0 ] && [ ! -f "$VAR_DIR/primary/$HOSTNAME.zone" ]; then if [ $zone_files = 0 ] && [ ! -f "$VAR_DIR/primary/$HOSTNAME.zone" ]; then
file_name="$VAR_DIR/primary/$HOSTNAME.zone"
cat <<EOF >>"$DNS_ZONE_FILE" cat <<EOF >>"$DNS_ZONE_FILE"
# ********** begin $HOSTNAME ********** # ********** begin $HOSTNAME **********
zone "$HOSTNAME" { zone "$HOSTNAME" {
@@ -362,7 +363,7 @@ $HOSTNAME. IN A $CONTAINER_IP4_ADDRESS
EOF EOF
fi fi
# #
if [ -d "$DATA_DIR/zones" ]; then if [ -d "$DATA_DIR/zones" ] && [ "$zone_files" -ne 0 ]; then
for dns_file in "$DATA_DIR/zones"/*; do for dns_file in "$DATA_DIR/zones"/*; do
file_name="$(basename "$dns_file")" file_name="$(basename "$dns_file")"
domain_name="$(grep -Rs '\$ORIGIN' "$dns_file" | awk '{print $NF}' | sed 's|.$||g')" domain_name="$(grep -Rs '\$ORIGIN' "$dns_file" | awk '{print $NF}' | sed 's|.$||g')"