polkit: add flag to disable systemctl

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-04-19 14:45:14 -04:00
parent 3ddbb9553d
commit d84f93d381
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A
1 changed files with 8 additions and 2 deletions

View File

@ -113,6 +113,7 @@ verify_ready()
CLEAR="n"
ROOT="n"
DISABLE_SYSTEMCTL="n"
# Parse command line arguments
while :; do
@ -123,6 +124,9 @@ while :; do
-r|--root)
ROOT="y"
;;
-z|--disable-systemctl)
DISABLE_SYSTEMCTL="y"
;;
*)
break
esac
@ -140,6 +144,8 @@ else
set -e
check_moonraker_service
add_polkit_rules
report_status "Restarting Moonraker..."
sudo systemctl restart moonraker
if [ $DISABLE_SYSTEMCTL = "n" ]; then
report_status "Restarting Moonraker..."
sudo systemctl restart moonraker
fi
fi