mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-13 02:24:27 +05:00
Add checks for octoprint service when installing DWC2/Mainsail
This commit is contained in:
@@ -220,15 +220,23 @@ flash_mcu(){
|
||||
start_klipper
|
||||
}
|
||||
|
||||
enable_octoprint_service(){
|
||||
status_msg "Octoprint Service is disabled! Enabling now ..."
|
||||
sudo systemctl enable octoprint -q && sudo systemctl start octoprint
|
||||
}
|
||||
|
||||
disable_octoprint_service(){
|
||||
status_msg "Octoprint Service is enabled! Disabling now ..."
|
||||
sudo systemctl stop octoprint && sudo systemctl disable octoprint -q
|
||||
}
|
||||
|
||||
toggle_octoprint_service(){
|
||||
if systemctl is-enabled octoprint.service -q; then
|
||||
status_msg "Service is enabled! Disabling now ..."
|
||||
sudo systemctl stop octoprint && sudo systemctl disable octoprint -q
|
||||
disable_octoprint_service
|
||||
sleep 2
|
||||
CONFIRM_MSG=" Octoprint Service is now >>> DISABLED <<< !"
|
||||
else
|
||||
status_msg "Service is disabled! Enabling now ..."
|
||||
sudo systemctl enable octoprint -q && sudo systemctl start octoprint
|
||||
enable_octoprint_service
|
||||
sleep 2
|
||||
CONFIRM_MSG=" Octoprint Service is now >>> ENABLED <<< !"
|
||||
fi
|
||||
|
||||
@@ -5,11 +5,15 @@
|
||||
dwc2_install_routine(){
|
||||
if [ -d $KLIPPER_DIR ]; then
|
||||
# check for existing installation
|
||||
if [ -d ${HOME}/klippy-env/lib/python2.7/site-packages/tornado ]; then
|
||||
ERROR_MSG=" Looks like DWC2 is already installed!\n Skipping..."
|
||||
return
|
||||
fi
|
||||
if [ -d ${HOME}/klippy-env/lib/python2.7/site-packages/tornado ]; then
|
||||
ERROR_MSG=" Looks like DWC2 is already installed!\n Skipping..."
|
||||
return
|
||||
fi
|
||||
stop_klipper
|
||||
#disable octoprint service if installed
|
||||
if systemctl is-enabled octoprint.service -q; then
|
||||
disable_octoprint_service
|
||||
fi
|
||||
install_tornado
|
||||
install_dwc2fk && dwc2fk_cfg
|
||||
install_dwc2
|
||||
|
||||
@@ -4,6 +4,10 @@ mainsail_install_routine(){
|
||||
dep=(wget curl unzip)
|
||||
dep_check
|
||||
#execute operation
|
||||
#disable octoprint service if installed
|
||||
if systemctl is-enabled octoprint.service -q; then
|
||||
disable_octoprint_service
|
||||
fi
|
||||
disable_wrong_webserver
|
||||
remove_wrong_webserver
|
||||
install_moonraker
|
||||
|
||||
Reference in New Issue
Block a user