mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 11:04:29 +05:00
fix: remove use of symlinks, also update for mainsail v0.2.0
This commit is contained in:
@@ -213,11 +213,24 @@ moonraker_setup(){
|
|||||||
ok_msg "Download complete!"
|
ok_msg "Download complete!"
|
||||||
status_msg "Installing Moonraker ..."
|
status_msg "Installing Moonraker ..."
|
||||||
$MOONRAKER_DIR/scripts/install-moonraker.sh
|
$MOONRAKER_DIR/scripts/install-moonraker.sh
|
||||||
#if [[ ! $(grep "klippy_uds" $KLIPPER_SERVICE2) ]]; then
|
#backup a possible existing printer.cfg at the old location
|
||||||
# status_msg "Patching /etc/default/klipper ..."
|
#and before patching in the new location
|
||||||
# sudo sed -i "/KLIPPY_ARGS/s/\.log/\.log -a \/tmp\/klippy_uds/" $KLIPPER_SERVICE2
|
backup_printer_cfg
|
||||||
# ok_msg "Patching done!"
|
#patching new printer.cfg location to /etc/default/klipper
|
||||||
#fi
|
if ! grep "/klipper_config/printer.cfg" $KLIPPER_SERVICE2; then
|
||||||
|
status_msg "Patching new printer.cfg location to /etc/default/klipper ..."
|
||||||
|
sudo sed -i "/KLIPPY_ARGS=/ s|$PRINTER_CFG|/home/${USER}/klipper_config/printer.cfg|" /etc/default/klipper
|
||||||
|
ok_msg "New location is: '/home/${USER}/klipper_config/printer.cfg'"
|
||||||
|
fi
|
||||||
|
#patching new UDS argument to /etc/default/klipper
|
||||||
|
if ! grep -- "-a /tmp/klippy_uds" $KLIPPER_SERVICE2; then
|
||||||
|
status_msg "Patching unix domain socket to /etc/default/klipper ..."
|
||||||
|
#append the new argument to /tmp/klippy.log argument
|
||||||
|
sudo sed -i "/KLIPPY_ARGS/s/\.log/\.log -a \/tmp\/klippy_uds/" $KLIPPER_SERVICE2
|
||||||
|
ok_msg "Patching done!"
|
||||||
|
fi
|
||||||
|
#re-run printer.cfg location function to read the new path for the printer.cfg
|
||||||
|
locate_printer_cfg
|
||||||
echo
|
echo
|
||||||
ok_msg "Moonraker successfully installed!"
|
ok_msg "Moonraker successfully installed!"
|
||||||
}
|
}
|
||||||
@@ -243,12 +256,12 @@ check_for_folder_moonraker(){
|
|||||||
setup_printer_config_mainsail(){
|
setup_printer_config_mainsail(){
|
||||||
if [ "$PRINTER_CFG_FOUND" = "true" ]; then
|
if [ "$PRINTER_CFG_FOUND" = "true" ]; then
|
||||||
backup_printer_cfg
|
backup_printer_cfg
|
||||||
#create a printer.cfg symlink to make it accessible
|
#copy printer.cfg to new location if
|
||||||
#in the mainsail config editor if the printer.cfg is not
|
#there is no printer.cfg at the new location already
|
||||||
#located in klipper_config by default
|
if [ -f ${HOME}/printer.cfg ] && [ ! -f ${HOME}/klipper_config/printer.cfg ]; then
|
||||||
if [ "$PRINTER_CFG" != "${HOME}/klipper_config/printer.cfg" ] && [ ! -f ${HOME}/klipper_config/printer.cfg ]; then
|
status_msg "Copy printer.cfg to new location ..."
|
||||||
status_msg "Create printer.cfg symlink ..."
|
cp ${HOME}/printer.cfg $PRINTER_CFG
|
||||||
ln -s $PRINTER_CFG ${HOME}/klipper_config
|
ok_msg "printer.cfg location: '$PRINTER_CFG'"
|
||||||
ok_msg "Done!"
|
ok_msg "Done!"
|
||||||
fi
|
fi
|
||||||
#check printer.cfg for necessary mainsail entries
|
#check printer.cfg for necessary mainsail entries
|
||||||
@@ -256,9 +269,9 @@ setup_printer_config_mainsail(){
|
|||||||
write_printer_cfg_mainsail
|
write_printer_cfg_mainsail
|
||||||
fi
|
fi
|
||||||
if [ "$SEL_DEF_CFG" = "true" ]; then
|
if [ "$SEL_DEF_CFG" = "true" ]; then
|
||||||
|
status_msg "Creating minimal default printer.cfg ..."
|
||||||
create_default_mainsail_printer_cfg
|
create_default_mainsail_printer_cfg
|
||||||
status_msg "Create symlink in home directory ..."
|
ok_msg "printer.cfg location: '$PRINTER_CFG'"
|
||||||
ln -s ${HOME}/klipper_config/printer.cfg ${HOME}
|
|
||||||
ok_msg "Done!"
|
ok_msg "Done!"
|
||||||
fi
|
fi
|
||||||
#copy mainsail_macro.cfg
|
#copy mainsail_macro.cfg
|
||||||
@@ -284,7 +297,7 @@ read_printer_cfg_mainsail(){
|
|||||||
if [ ! $(grep '^\[display_status\]$' $PRINTER_CFG) ]; then
|
if [ ! $(grep '^\[display_status\]$' $PRINTER_CFG) ]; then
|
||||||
DISPLAY_STATUS="false"
|
DISPLAY_STATUS="false"
|
||||||
fi
|
fi
|
||||||
if [ ! "$(grep '^\[include klipper_config\/mainsail_macros\.cfg\]$' $PRINTER_CFG)" ]; then
|
if [ ! "$(grep '^\[include mainsail_macros\.cfg\]$' $PRINTER_CFG)" ]; then
|
||||||
MS_MACRO="false"
|
MS_MACRO="false"
|
||||||
fi
|
fi
|
||||||
#check for a SAVE_CONFIG entry
|
#check for a SAVE_CONFIG entry
|
||||||
@@ -300,7 +313,7 @@ read_printer_cfg_mainsail(){
|
|||||||
write_printer_cfg_mainsail(){
|
write_printer_cfg_mainsail(){
|
||||||
unset write_entries
|
unset write_entries
|
||||||
if [ "$MS_MACRO" = "false" ] && [ "$ADD_MS_MACROS" = "true" ]; then
|
if [ "$MS_MACRO" = "false" ] && [ "$ADD_MS_MACROS" = "true" ]; then
|
||||||
write_entries+=("[include klipper_config/mainsail_macros.cfg]")
|
write_entries+=("[include mainsail_macros.cfg]")
|
||||||
fi
|
fi
|
||||||
if [ "$PAUSE_RESUME" = "false" ]; then
|
if [ "$PAUSE_RESUME" = "false" ]; then
|
||||||
write_entries+=("[pause_resume]")
|
write_entries+=("[pause_resume]")
|
||||||
|
|||||||
Reference in New Issue
Block a user