scripts: add a --root argument to set-policykit-rules.sh

If a user specifies this then root is allowed to run the script.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-01-30 15:20:49 -05:00
parent f616c83ebc
commit 10ac044485
1 changed files with 23 additions and 3 deletions

View File

@ -111,10 +111,30 @@ verify_ready()
fi fi
} }
CLEAR="$1" CLEAR="n"
verify_ready ROOT="n"
if [ "$CLEAR" = "--clear" ] || [ "$CLEAR" = "-c" ]; then # Parse command line arguments
while :; do
case $1 in
-c|--clear)
CLEAR="y"
;;
-r|--root)
ROOT="y"
;;
*)
break
esac
shift
done
if [ "$ROOT" = "n" ]; then
verify_ready
fi
if [ "$CLEAR" = "y" ]; then
clear_polkit_rules clear_polkit_rules
else else
set -e set -e