diff options
author | Erich Eckner <git@eckner.net> | 2021-01-02 20:52:08 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2021-01-02 20:52:08 +0100 |
commit | 79fd68d3d2c412ead7cb655ab813a0b25d5e1a6f (patch) | |
tree | c968c50bff1cde62e8296791dbfeea8da91bc2b1 /update-me.in | |
parent | f764698c8ab5080a7cbe308a3c653cc4652aea5a (diff) | |
download | update-all-79fd68d3d2c412ead7cb655ab813a0b25d5e1a6f.tar.xz |
update-me: correctly unwrap `bash -c "..."`
Diffstat (limited to 'update-me.in')
-rw-r--r-- | update-me.in | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/update-me.in b/update-me.in index dcac3af..0c84c16 100644 --- a/update-me.in +++ b/update-me.in @@ -72,9 +72,14 @@ fi command_needs_root() { local cmd - cmd="$1" - cmd="${cmd%% *}" - cmd="${cmd##*/}" + cmd=$( + printf '%s\n' "$1" \ + | sed ' + s@^bash -c "\(.*\)"$@\1@ + s@ .*$@@ + s@^.*/@@ + ' + ) if [ "${cmd}" = 'mount' ] \ || [ "${cmd}" = 'checkservices' ] \ || [ "${cmd}" = 'check-kernel' ]; then |