mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-11-26 00:46:56 -05:00
31 lines
818 B
Bash
Executable file
31 lines
818 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Copyright (C) 2025 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
|
|
# See the file COPYING for copying conditions.
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o errtrace
|
|
set -o pipefail
|
|
|
|
source /usr/libexec/helper-scripts/strings.bsh
|
|
|
|
## Make sure globs sort in a predictable, reproducible fashion
|
|
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
|
|
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
|
|
ENSURE_SHUTDOWN_TIMEOUT=30;
|
|
fi
|
|
|
|
/run/emerg-shutdown --monitor-fifo "--timeout=${ENSURE_SHUTDOWN_TIMEOUT}" &
|
|
sleep 1
|
|
disown
|
|
exit 0
|