security-misc/usr/lib/dracut/modules.d/10ram-wipe-exit/wipe-ram-needshutdown.sh

28 lines
455 B
Bash
Raw Normal View History

2023-01-06 10:50:34 -05:00
#!/bin/sh
2023-01-06 12:50:58 -05:00
### Copyrigh (C) 2023 - 2023 Friedrich Doku <friedrichdoku@gmail.com>
2023-01-06 10:50:34 -05:00
ram_wipe_check_needshutdown() {
local wipe_action
wipe_action=$(getarg wiperamaction)
wait $(pgrep sdmem)
info "DONE WAITING..."
if [ "$wipe_action" = "reboot" ]; then
reboot -f
fi
if [ "$wipe_action" = "poweroff" ]; then
poweroff -f
fi
if [ "$wipe_action" = "halt" ]; then
halt -f
fi
}
ram_wipe_check_needshutdown