2024-08-27 09:44:41 -04:00
|
|
|
#!/usr/bin/env bash
|
2026-05-05 19:11:09 -04:00
|
|
|
# shellcheck shell=bash
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
##@Version : 202605051438-git
|
2024-08-27 09:44:41 -04:00
|
|
|
# @@Author : CasjaysDev
|
|
|
|
|
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
|
|
|
|
# @@License : MIT
|
2026-05-05 19:11:09 -04:00
|
|
|
# @@Copyright : Copyright 2026 CasjaysDev
|
|
|
|
|
# @@Created : Tue May 5 02:38:04 PM EDT 2026
|
2024-08-27 09:44:41 -04:00
|
|
|
# @@File : 05-custom.sh
|
|
|
|
|
# @@Description : script to run custom
|
2026-05-05 19:11:09 -04:00
|
|
|
# @@Changelog : newScript
|
|
|
|
|
# @@TODO : Refactor code
|
|
|
|
|
# @@Other : N/A
|
|
|
|
|
# @@Resource : N/A
|
|
|
|
|
# @@Terminal App : yes
|
|
|
|
|
# @@sudo/root : yes
|
|
|
|
|
# @@Template : templates/dockerfiles/init_scripts/05-custom.sh
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
# shellcheck disable=SC1001,SC1003,SC2001,SC2003,SC2016,SC2031,SC2090,SC2115,SC2120,SC2155,SC2199,SC2229,SC2317,SC2329
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
2024-08-27 09:44:41 -04:00
|
|
|
# Set bash options
|
|
|
|
|
set -o pipefail
|
|
|
|
|
[ "$DEBUGGER" = "on" ] && echo "Enabling debugging" && set -x$DEBUGGER_OPTIONS
|
2026-05-05 19:11:09 -04:00
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
2024-08-27 09:44:41 -04:00
|
|
|
# Set env variables
|
|
|
|
|
exitCode=0
|
|
|
|
|
|
2026-05-05 19:11:09 -04:00
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
# Predefined actions
|
2024-08-27 09:44:41 -04:00
|
|
|
|
2026-05-05 19:11:09 -04:00
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
2024-08-27 09:44:41 -04:00
|
|
|
# Main script
|
2026-05-12 20:05:33 -04:00
|
|
|
# wipe-and-replace per template §4: ensure /etc/bind contains ONLY our
|
|
|
|
|
# optimized config. 02-packages.sh + 03-files.sh already do this; the
|
|
|
|
|
# block below makes the intent explicit and survives reorderings.
|
|
|
|
|
if [ -d "/tmp/etc/bind" ]; then
|
|
|
|
|
rm -Rf "/etc/bind"/*
|
|
|
|
|
cp -Rf "/tmp/etc/bind/." "/etc/bind/"
|
|
|
|
|
fi
|
|
|
|
|
# Runtime dirs that named needs to exist on first boot (the init.d
|
|
|
|
|
# script will recreate these too, but pre-creating avoids a chown -R
|
|
|
|
|
# failure on a missing dir during __run_pre_execute_checks).
|
|
|
|
|
mkdir -p /run/bind /data/logs/bind /var/bind/primary /var/bind/secondary \
|
|
|
|
|
/var/bind/stats /var/bind/dynamic /var/bind/zones
|
|
|
|
|
chown -Rf named:named /etc/bind /var/bind 2>/dev/null || true
|
2024-08-27 09:44:41 -04:00
|
|
|
|
2026-05-05 19:11:09 -04:00
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
2024-08-27 09:44:41 -04:00
|
|
|
# Set the exit code
|
2026-05-05 19:11:09 -04:00
|
|
|
#exitCode=$?
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
2024-08-27 09:44:41 -04:00
|
|
|
exit $exitCode
|
2026-05-05 19:11:09 -04:00
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
# ex: ts=2 sw=2 et filetype=sh
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
|