2023-01-06 10:50:34 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-01-06 13:52:42 -05:00
|
|
|
## Copyright (C) 2023 - 2023 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
|
|
|
|
## Copyright (C) 2023 - 2023 Friedrich Doku <friedrichdoku@gmail.com>
|
2023-01-06 13:47:23 -05:00
|
|
|
## See the file COPYING for copying conditions.
|
2023-01-06 10:50:34 -05:00
|
|
|
|
|
|
|
ram_wipe_check_needshutdown() {
|
|
|
|
local wipe_action
|
|
|
|
wipe_action=$(getarg wiperamaction)
|
|
|
|
|
|
|
|
wait $(pgrep sdmem)
|
2023-01-07 12:49:18 -05:00
|
|
|
info "wipe-ram.sh wiperamexit: DONE WAITING..."
|
2023-01-06 10:50:34 -05:00
|
|
|
|
|
|
|
if [ "$wipe_action" = "reboot" ]; then
|
|
|
|
reboot -f
|
|
|
|
fi
|
2023-01-07 12:43:07 -05:00
|
|
|
|
2023-01-06 10:50:34 -05:00
|
|
|
if [ "$wipe_action" = "poweroff" ]; then
|
|
|
|
poweroff -f
|
|
|
|
fi
|
2023-01-07 12:43:07 -05:00
|
|
|
|
2023-01-06 10:50:34 -05:00
|
|
|
if [ "$wipe_action" = "halt" ]; then
|
|
|
|
halt -f
|
|
|
|
fi
|
2023-01-07 12:43:07 -05:00
|
|
|
|
2023-01-06 21:32:57 -05:00
|
|
|
if [ "$wipe_action" = "error" ]; then
|
2023-01-07 12:49:18 -05:00
|
|
|
info "wipe-ram.sh wiperamexit: Choice of shutdown option led to an error. Shutting down..."
|
2023-01-07 12:43:07 -05:00
|
|
|
sleep 5
|
|
|
|
poweroff -f
|
2023-01-06 21:32:57 -05:00
|
|
|
fi
|
2023-01-06 10:50:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
ram_wipe_check_needshutdown
|