modified moonraker update management section and install

This commit is contained in:
Félix Boisselier
2024-01-09 16:14:37 +00:00
parent 84c406b407
commit ac96cb2eb7
4 changed files with 36 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
#!/bin/bash
USER_CONFIG_PATH="${HOME}/printer_data/config"
MOONRAKER_CONFIG="${HOME}/printer_data/config/moonraker.conf"
KLIPPER_PATH="${HOME}/klipper"
K_SHAKETUNE_PATH="${HOME}/klippain_shaketune"
@@ -110,11 +111,24 @@ function link_gcodeshellcommandpy {
fi
}
function add_updater {
update_section=$(grep -c '\[update_manager[a-z ]* Klippain-ShakeTune\]' $MOONRAKER_CONFIG || true)
if [ "$update_section" -eq 0 ]; then
echo -n "[INSTALL] Adding update manager to moonraker.conf..."
cat ${K_SHAKETUNE_PATH}/moonraker.conf >> $MOONRAKER_CONFIG
fi
}
function restart_klipper {
echo "[POST-INSTALL] Restarting Klipper..."
sudo systemctl restart klipper
}
function restart_moonraker {
echo "[POST-INSTALL] Restarting Moonraker..."
sudo systemctl restart moonraker
}
printf "\n=============================================\n"
echo "- Klippain Shake&Tune module install script -"
@@ -126,5 +140,7 @@ preflight_checks
check_download
setup_venv
link_extension
add_updater
link_gcodeshellcommandpy
restart_klipper
restart_moonraker