Fix emerg-shutdown and ensure-shutdown libexec scripts, start emerg-shutdown and ensure-shutdown earlier

This commit is contained in:
Aaron Rainbolt 2025-08-03 15:00:14 -05:00
parent d1bca0204f
commit 63f2909341
No known key found for this signature in database
GPG key ID: A709160D73C79109
9 changed files with 83 additions and 15 deletions

View file

@ -13,8 +13,10 @@ export LC_ALL=C
## Read emergency shutdown key configuration
for config_file in /etc/security-misc/emerg-shutdown/*.conf /usr/local/etc/security-misc/emerg-shutdown/*.conf; do
bash -n "${config_file}"
source "${config_file}"
if [ -f "${config_file}" ]; then
bash -n "${config_file}"
source "${config_file}"
fi
done
if [ -z "${EMERG_SHUTDOWN_KEYS}" ]; then
## Default to Ctrl+Alt+Delete if nothing else is set

View file

@ -15,8 +15,10 @@ export LC_ALL=C
## Read emergency shutdown key configuration
for config_file in /etc/security-misc/emerg-shutdown/*.conf /usr/local/etc/security-misc/emerg-shutdown/*.conf; do
bash -n "${config_file}"
source "${config_file}"
if [ -f "${config_file}" ]; then
bash -n "${config_file}"
source "${config_file}"
fi
done
if [ -z "${ENSURE_SHUTDOWN_TIMEOUT}" ] \
|| ! is_whole_number "${ENSURE_SHUTDOWN_TIMEOUT}"; then