install: add flag to disable systemctl

The "-z" flag will run the install script without running the
systemctl command.  This is useful for installations which
are done outside of the normal "boot" process.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-04-19 14:07:43 -04:00
parent 4be8e2e72f
commit b06f782665
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A
1 changed files with 10 additions and 4 deletions

View File

@ -6,6 +6,7 @@ PYTHONDIR="${HOME}/moonraker-env"
SYSTEMDDIR="/etc/systemd/system"
REBUILD_ENV="n"
FORCE_DEFAULTS="n"
DISABLE_SYSTEMCTL="n"
CONFIG_PATH="${HOME}/moonraker.conf"
LOG_PATH="/tmp/moonraker.log"
@ -89,8 +90,10 @@ Restart=always
RestartSec=10
EOF
# Use systemctl to enable the klipper systemd service script
if [ $DISABLE_SYSTEMCTL = "n" ]; then
sudo systemctl enable moonraker.service
sudo systemctl daemon-reload
fi
}
check_polkit_rules()
@ -149,10 +152,11 @@ SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )"
LAUNCH_CMD="${PYTHONDIR}/bin/python ${SRCDIR}/moonraker/moonraker.py"
# Parse command line arguments
while getopts "rfc:l:" arg; do
while getopts "rfzc:l:" arg; do
case $arg in
r) REBUILD_ENV="y";;
f) FORCE_DEFAULTS="y";;
z) DISABLE_SYSTEMCTL="y";;
c) CONFIG_PATH=$OPTARG;;
l) LOG_PATH=$OPTARG;;
esac
@ -165,4 +169,6 @@ install_packages
create_virtualenv
install_script
check_polkit_rules
start_software
if [ $DISABLE_SYSTEMCTL = "n" ]; then
start_software
fi