diff options
author | Erich Eckner <git@eckner.net> | 2019-08-22 13:55:28 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-08-22 13:55:28 +0200 |
commit | fca58bcc06234bddfe4ee25a5f3b47072afcf7c0 (patch) | |
tree | 12d6928114da7af89cb24ba10d5b67fc82d41375 /update-me.in | |
parent | c178f41d098318143b04f3fb34e165d856d65d1d (diff) | |
download | update-all-fca58bcc06234bddfe4ee25a5f3b47072afcf7c0.tar.xz |
update-me: check /boot _and_ / for remount
Diffstat (limited to 'update-me.in')
-rw-r--r-- | update-me.in | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/update-me.in b/update-me.in index 09025fc..cff74f3 100644 --- a/update-me.in +++ b/update-me.in @@ -4,15 +4,17 @@ preCmds=('hostname') cmds=() postCmds=('sync') -if mountpoint -q /boot \ -&& mount \ - | grep -wF '/boot' \ - | cut -d' ' -f6 \ - | grep -qwF 'ro' \ -&& [ ! -d '#ETCDIR#/ports' ]; then - preCmds+=('mount -o remount,rw /boot') - postCmds+=('mount -o remount,ro /boot') -fi +for mp in '/' '/boot'; do + mountpoint -q "${mp}" || continue + mount \ + | cut -d' ' -f3,6 \ + | grep "^${mp}\s" \ + | cut -d' ' -f2 \ + | grep -qwF 'ro' || continue + [ "${mp}" = '/boot' ] && [ -d '#ETCDIR#/ports' ] && continue + preCmds+=('mount -o remount,rw '"${mp}") + postCmds+=('mount -o remount,ro '"${mp}") +done if command -v check-kernel >/dev/null; then postCmds+=('check-kernel -r') |