diff options
-rw-r--r-- | update-me.in | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/update-me.in b/update-me.in index 14d1716..2ec41e2 100644 --- a/update-me.in +++ b/update-me.in @@ -51,7 +51,15 @@ for mp in '/' '/boot'; do | grep -qwF 'ro' || continue [ "${mp}" = '/boot' ] && [ -d '#ETCDIR#/ports' ] && continue preCmds+=('mount -o remount,rw '"${mp}") - postCmds+=('mount -o remount,ro '"${mp}"' || reboot') + if command -v shutdownasap >/dev/null; then + if command -v screen >/dev/null; then + postCmds+=('mount -o remount,ro '"${mp}"' || screen -d -m "shutdownasap -r"') + else + postCmds+=('mount -o remount,ro '"${mp}"' || shutdownasap -r') + fi + else + postCmds+=('mount -o remount,ro '"${mp}"' || reboot') + fi done if command -v check-kernel >/dev/null; then |