mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 02:54:28 +05:00
fix: rework moonraker update function
This commit is contained in:
@@ -116,25 +116,53 @@ update_fluidd(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_moonraker(){
|
update_moonraker(){
|
||||||
stop_moonraker
|
|
||||||
bb4u "moonraker"
|
bb4u "moonraker"
|
||||||
status_msg "Updating Moonraker ..."
|
status_msg "Updating Moonraker ..."
|
||||||
if [ ! -d $MOONRAKER_DIR ]; then
|
while true; do
|
||||||
cd ${HOME} && git clone $MOONRAKER_REPO
|
echo
|
||||||
else
|
top_border
|
||||||
cd $MOONRAKER_DIR && git pull
|
echo -e "| You can now choose how you want to update Moonraker. |"
|
||||||
#check for possible new dependencies and install them
|
blank_line
|
||||||
status_msg "Checking for possible new dependencies ..."
|
echo -e "| It is possible, that changes made to the Moonraker |"
|
||||||
PKGLIST="$(grep "PKGLIST=" ~/moonraker/scripts/install-moonraker.sh | cut -d'"' -f2- | cut -d'"' -f1)"
|
echo -e "| code and/or its dependencies might require a rebuild |"
|
||||||
PYTHONDIR="${HOME}/moonraker-env"
|
echo -e "| of the python virtual envrionment. |"
|
||||||
sudo apt-get update && sudo apt-get install --yes $PKGLIST
|
blank_line
|
||||||
$PYTHONDIR/bin/pip install -r ~/moonraker/scripts/moonraker-requirements.txt
|
echo -e "| Please check the docs in the Moonraker repository to |"
|
||||||
ok_msg "Dependencies already met or have been installed!"
|
echo -e "| see if a rebuild is necessary (user_changes.md). |"
|
||||||
|
blank_line
|
||||||
|
echo -e "| 1) Update Moonraker (default) |"
|
||||||
|
echo -e "| 2) Update Moonraker + rebuild virtualenv |"
|
||||||
|
quit_footer
|
||||||
|
read -p "${cyan}###### Please choose:${default} " action
|
||||||
|
case "$action" in
|
||||||
|
1|"")
|
||||||
|
echo -e "###### > Update Moonraker"
|
||||||
|
update_mr="true"
|
||||||
|
rebuild_env="false"
|
||||||
|
break;;
|
||||||
|
2)
|
||||||
|
echo -e "###### > Update Moonraker + rebuild virtualenv"
|
||||||
|
update_mr="true"
|
||||||
|
rebuild_env="true"
|
||||||
|
break;;
|
||||||
|
Q|q)
|
||||||
|
clear; update_menu; break;;
|
||||||
|
*)
|
||||||
|
print_unkown_cmd
|
||||||
|
print_msg && clear_msg;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
stop_moonraker; echo
|
||||||
|
if [[ $update_mr = "true" ]] && [[ $rebuild_env = "false" ]]; then
|
||||||
|
unset update_mr && unset rebuild_env
|
||||||
|
cd $MOONRAKER_DIR && git pull && ./scripts/install-moonraker.sh
|
||||||
fi
|
fi
|
||||||
#read default printer.cfg location for the patch function
|
if [[ $update_mr = "true" ]] && [[ $rebuild_env = "true" ]]; then
|
||||||
locate_printer_cfg
|
unset update_mr && unset rebuild_env
|
||||||
#patch /etc/default/klipper if entries don't match
|
cd $MOONRAKER_DIR && git pull && ./scripts/install-moonraker.sh -r
|
||||||
patch_klipper_sysfile
|
fi
|
||||||
|
#read printer.cfg location and patch /etc/default/klipper if entries don't match
|
||||||
|
locate_printer_cfg && patch_klipper_sysfile
|
||||||
ok_msg "Update complete!"
|
ok_msg "Update complete!"
|
||||||
start_moonraker
|
start_moonraker
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user