Files
bind/rootfs/root/docker/setup/05-custom.sh
T

57 lines
2.2 KiB
Bash
Raw Normal View History

2024-08-27 09:44:41 -04:00
#!/usr/bin/env bash
# shellcheck shell=bash
# - - - - - - - - - - - - - - - - - - - - - - - - -
##@Version : 202605051438-git
2024-08-27 09:44:41 -04:00
# @@Author : CasjaysDev
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
# @@License : MIT
# @@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
# @@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
# - - - - - - - - - - - - - - - - - - - - - - - - -
2024-08-27 09:44:41 -04:00
# Set env variables
exitCode=0
# - - - - - - - - - - - - - - - - - - - - - - - - -
# Predefined actions
2024-08-27 09:44:41 -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
# - - - - - - - - - - - - - - - - - - - - - - - - -
2024-08-27 09:44:41 -04:00
# Set the exit code
#exitCode=$?
# - - - - - - - - - - - - - - - - - - - - - - - - -
2024-08-27 09:44:41 -04:00
exit $exitCode
# - - - - - - - - - - - - - - - - - - - - - - - - -
# ex: ts=2 sw=2 et filetype=sh
# - - - - - - - - - - - - - - - - - - - - - - - - -