summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--update-me.in11
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