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
}
CLEAR="$1"
verify_ready
CLEAR="n"
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
else
set -e