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

@@ -29,18 +29,6 @@ Follow these steps to install the Shake&Tune module in your printer:
```
[include K-ShakeTune/*.cfg]
```
1. Finally, if you want to get automatic updates, add the following to your `moonraker.cfg` file:
```
[update_manager Klippain-ShakeTune]
type: git_repo
path: ~/klippain_shaketune
channel: beta
origin: https://github.com/Frix-x/klippain-shaketune.git
primary_branch: main
managed_services: klipper
install_script: install.sh
```
## Usage

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

11
moonraker.conf Normal file
View File

@@ -0,0 +1,11 @@
## Klippain Shake&Tune automatic update management
[update_manager Klippain-ShakeTune]
type: git_repo
origin: https://github.com/Frix-x/klippain-shaketune.git
path: ~/klippain_shaketune
virtualenv: ~/klippain_shaketune-env
requirements: requirements.txt
system_dependencies: system-dependencies.json
primary_branch: main
managed_services: klipper

9
system-dependencies.json Normal file
View File

@@ -0,0 +1,9 @@
{
"debian": [
"python3-venv",
"python3-numpy",
"python3-matplotlib",
"libopenblas-dev",
"libatlas-base-dev"
]
}