From 79fd68d3d2c412ead7cb655ab813a0b25d5e1a6f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 2 Jan 2021 20:52:08 +0100 Subject: update-me: correctly unwrap `bash -c "..."` --- update-me.in | 11 ++++++++--- 1 file 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 -- cgit v1.2.3-70-g09d2