diff options
author | Erich Eckner <git@eckner.net> | 2018-01-11 08:47:30 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-01-11 08:47:30 +0100 |
commit | 511085ee14724f4774bc9e82b8705453f6636b56 (patch) | |
tree | 248eabefa57b138a9ad8d4322b3e84ca04d358b1 | |
parent | e7322875057949c6d949babfb294de432fcbaa06 (diff) | |
download | update-all-511085ee14724f4774bc9e82b8705453f6636b56.tar.xz |
update-me.in: use sudo on check-kernel if $hasSudo
-rw-r--r-- | update-me.in | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/update-me.in b/update-me.in index bb979d4..e5f194b 100644 --- a/update-me.in +++ b/update-me.in @@ -10,6 +10,14 @@ fi . #ETCDIR#/update-me.conf +if "${hasSudo}"; then + for ((i=0; i<${postCmds[@]}; i++)); do + if [ "${postCmd[${i}]}" = 'check-kernel -r' ]; then + postCmd[${i}]='sudo check-kernel -r'; + fi + done +fi + if [ ! "$(whoami)" == "root" ] then if ! "${hasSudo}" |