Add initial setup scripts for Debian 13 Trixie LUKS template

This commit is contained in:
Philip Henning 2026-02-08 16:19:33 +01:00
parent 4142a521ba
commit 687775a5e5
2 changed files with 766 additions and 0 deletions

View file

@ -0,0 +1,26 @@
#! /bin/sed 2,5!d;s/^#.//
# This script must be sourced from within a shell
# and not executed. For instance with:
#
# . /usr/local/bin/initial-setup.sh
# Only run in interactive shells
case $- in
*i*) ;;
*) return ;;
esac
if [ "$EUID" -ne 0 ]; then
if ! command -v sudo >/dev/null 2>&1 || ! sudo -n true >/dev/null 2>&1; then
echo "Error: must be root or have sudo privileges to run initial login setup." >&2
return
fi
fi
SENTINEL="/var/lib/initial-login-setup.done"
if [ ! -f "$SENTINEL" ] && [ -x /usr/local/bin/initial-setup.sh ]; then
#DEBUG touch SENTINEL before running the setup script to prevent infinite loops during development
sudo /usr/local/bin/initial-setup.sh
sudo touch "$SENTINEL"
fi