mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-15 11:34:27 +05:00
fix: bug with sourcing the kiauh.ini and improve config change function
This commit is contained in:
@@ -29,7 +29,15 @@ check_klipper_cfg_path(){
|
|||||||
change_klipper_cfg_path(){
|
change_klipper_cfg_path(){
|
||||||
source_kiauh_ini
|
source_kiauh_ini
|
||||||
old_klipper_cfg_loc="$klipper_cfg_loc"
|
old_klipper_cfg_loc="$klipper_cfg_loc"
|
||||||
|
EXAMPLE_FOLDER=$(printf "%s/your_config_folder" "${HOME}")
|
||||||
while true; do
|
while true; do
|
||||||
|
top_border
|
||||||
|
echo -e "| ${red}IMPORTANT:${default} |"
|
||||||
|
echo -e "| Please enter the new path in the following form: |"
|
||||||
|
printf "| ${yellow}%-51s${default} |\n" "$EXAMPLE_FOLDER"
|
||||||
|
blank_line
|
||||||
|
echo -e "| By default 'klipper_config' is recommended! |"
|
||||||
|
bottom_border
|
||||||
echo
|
echo
|
||||||
echo -e "${cyan}###### Please set the Klipper config directory:${default} "
|
echo -e "${cyan}###### Please set the Klipper config directory:${default} "
|
||||||
if [ -z "$old_klipper_cfg_loc" ]; then
|
if [ -z "$old_klipper_cfg_loc" ]; then
|
||||||
@@ -52,7 +60,6 @@ change_klipper_cfg_path(){
|
|||||||
|
|
||||||
### write new location to klipper and moonraker service
|
### write new location to klipper and moonraker service
|
||||||
set_klipper_cfg_path
|
set_klipper_cfg_path
|
||||||
|
|
||||||
echo; ok_msg "Config directory changed!"
|
echo; ok_msg "Config directory changed!"
|
||||||
break;;
|
break;;
|
||||||
N|n|No|no)
|
N|n|No|no)
|
||||||
@@ -126,7 +133,7 @@ set_klipper_cfg_path(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
source_kiauh_ini(){
|
source_kiauh_ini(){
|
||||||
source ${SRCDIR}/kiauh/kiauh.ini
|
source $INI_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
klipper_service(){
|
klipper_service(){
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ settings_ui(){
|
|||||||
echo -e "| $(title_msg "~~~~~~~~~~~~ [ KIAUH Settings ] ~~~~~~~~~~~~~") | "
|
echo -e "| $(title_msg "~~~~~~~~~~~~ [ KIAUH Settings ] ~~~~~~~~~~~~~") | "
|
||||||
hr
|
hr
|
||||||
echo -e "| ${red}Caution:${default} | "
|
echo -e "| ${red}Caution:${default} | "
|
||||||
echo -e "| When you rename the config folder, be aware that ALL | "
|
echo -e "| When you change the config folder, be aware that ALL | "
|
||||||
echo -e "| Klipper and Moonraker services will be STOPPED, | "
|
echo -e "| Klipper and Moonraker services will be STOPPED, | "
|
||||||
echo -e "| reconfigured and then restarted again. | "
|
echo -e "| reconfigured and then restarted again. | "
|
||||||
blank_line
|
blank_line
|
||||||
echo -e "| ${red}DO NOT rename the folder during printing!${default} | "
|
echo -e "| ${red}DO NOT change the folder during printing!${default} | "
|
||||||
hr
|
hr
|
||||||
blank_line
|
blank_line
|
||||||
echo -e "| ${yellow}● Current Klipper config folder:${default} | "
|
echo -e "| ${cyan}● Current Klipper config folder:${default} | "
|
||||||
printf "|%-55s|\n" " $klipper_cfg_loc"
|
printf "|%-55s|\n" " $klipper_cfg_loc"
|
||||||
blank_line
|
blank_line
|
||||||
hr
|
hr
|
||||||
echo -e "| 1) Rename config folder | "
|
echo -e "| 1) Change config folder | "
|
||||||
quit_footer
|
quit_footer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user