summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-04-27 14:11:18 +0200
committerErich Eckner <git@eckner.net>2020-04-27 14:11:18 +0200
commit8b6e4bfebdf6d5f363c19d29fc42dfc131a19995 (patch)
tree755dc7f55bb7eb2d1e846f67b21613f4583bcbc2
parent157b945c7db396737384466f5357d30abbf517f4 (diff)
downloadupdate-all-8b6e4bfebdf6d5f363c19d29fc42dfc131a19995.tar.xz
update-me: use shutdownasap (within screen) if available - instead of reboot
-rw-r--r--update-me.in10
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