From 8b6e4bfebdf6d5f363c19d29fc42dfc131a19995 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 27 Apr 2020 14:11:18 +0200 Subject: update-me: use shutdownasap (within screen) if available - instead of reboot --- update-me.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-54-g00ecf