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