mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 19:14:27 +05:00
fix: moonraker update function - check for patched klipper sysfile
This commit is contained in:
@@ -23,7 +23,7 @@ locate_printer_cfg(){
|
|||||||
ok_msg "printer.cfg location: '$PRINTER_CFG'"
|
ok_msg "printer.cfg location: '$PRINTER_CFG'"
|
||||||
else
|
else
|
||||||
PRINTER_CFG=""
|
PRINTER_CFG=""
|
||||||
warn_msg "Couldn't locate printer.cfg - File not found!"
|
warn_msg "Can't read /etc/default/klipper - File not found!"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,6 +216,15 @@ moonraker_setup(){
|
|||||||
#backup a possible existing printer.cfg at the old location
|
#backup a possible existing printer.cfg at the old location
|
||||||
#and before patching in the new location
|
#and before patching in the new location
|
||||||
backup_printer_cfg
|
backup_printer_cfg
|
||||||
|
patch_klipper_sysfile
|
||||||
|
#re-run printer.cfg location function to read the new path for the printer.cfg
|
||||||
|
locate_printer_cfg
|
||||||
|
echo
|
||||||
|
ok_msg "Moonraker successfully installed!"
|
||||||
|
}
|
||||||
|
|
||||||
|
patch_klipper_sysfile(){
|
||||||
|
status_msg "Checking /etc/default/klipper for necessary entries ..."
|
||||||
#patching new printer.cfg location to /etc/default/klipper
|
#patching new printer.cfg location to /etc/default/klipper
|
||||||
if ! grep -q "/klipper_config/printer.cfg" $KLIPPER_SERVICE2; then
|
if ! grep -q "/klipper_config/printer.cfg" $KLIPPER_SERVICE2; then
|
||||||
status_msg "Patching new printer.cfg location to /etc/default/klipper ..."
|
status_msg "Patching new printer.cfg location to /etc/default/klipper ..."
|
||||||
@@ -229,10 +238,8 @@ moonraker_setup(){
|
|||||||
sudo sed -i "/KLIPPY_ARGS/s/\.log/\.log -a \/tmp\/klippy_uds/" $KLIPPER_SERVICE2
|
sudo sed -i "/KLIPPY_ARGS/s/\.log/\.log -a \/tmp\/klippy_uds/" $KLIPPER_SERVICE2
|
||||||
ok_msg "Patching done!"
|
ok_msg "Patching done!"
|
||||||
fi
|
fi
|
||||||
#re-run printer.cfg location function to read the new path for the printer.cfg
|
ok_msg "Check complete!"
|
||||||
locate_printer_cfg
|
|
||||||
echo
|
echo
|
||||||
ok_msg "Moonraker successfully installed!"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_for_folder_moonraker(){
|
check_for_folder_moonraker(){
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ update_moonraker(){
|
|||||||
else
|
else
|
||||||
cd $MOONRAKER_DIR && git pull
|
cd $MOONRAKER_DIR && git pull
|
||||||
fi
|
fi
|
||||||
|
#read default printer.cfg location for the patch function
|
||||||
|
locate_printer_cfg
|
||||||
|
#patch /etc/default/klipper if entries don't match
|
||||||
|
patch_klipper_sysfile
|
||||||
ok_msg "Update complete!"
|
ok_msg "Update complete!"
|
||||||
start_moonraker && sleep 2 && start_klipper
|
start_moonraker && sleep 2 && start_klipper
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user