#!/usr/bin/env bash # shellcheck shell=bash # - - - - - - - - - - - - - - - - - - - - - - - - - ##@Version : 202605051438-git # @@Author : CasjaysDev # @@Contact : CasjaysDev # @@License : MIT # @@Copyright : Copyright 2026 CasjaysDev # @@Created : Tue May 5 02:38:04 PM EDT 2026 # @@File : 05-custom.sh # @@Description : script to run custom # @@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 # - - - - - - - - - - - - - - - - - - - - - - - - - # Set bash options set -o pipefail [ "$DEBUGGER" = "on" ] && echo "Enabling debugging" && set -x$DEBUGGER_OPTIONS # - - - - - - - - - - - - - - - - - - - - - - - - - # Set env variables exitCode=0 # - - - - - - - - - - - - - - - - - - - - - - - - - # Predefined actions # - - - - - - - - - - - - - - - - - - - - - - - - - # Main script # 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 # - - - - - - - - - - - - - - - - - - - - - - - - - # Set the exit code #exitCode=$? # - - - - - - - - - - - - - - - - - - - - - - - - - exit $exitCode # - - - - - - - - - - - - - - - - - - - - - - - - - # ex: ts=2 sw=2 et filetype=sh # - - - - - - - - - - - - - - - - - - - - - - - - -