heads/initrd/bin/poweroff

19 lines
304 B
Bash
Executable File

#!/bin/bash
. /etc/functions
TRACE_FUNC
# Shut down TPM
if [ "$CONFIG_TPM" = "y" ]; then
tpmr shutdown
fi
# Sync all mounted filesystems
echo s > /proc/sysrq-trigger
# Remount all mounted filesystems in read-only mode
echo u > /proc/sysrq-trigger
# Shut off the system
echo o > /proc/sysrq-trigger