refactor: replace ${default} with ${white}

Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
th33xitus
2022-04-02 23:34:31 +02:00
parent d1cb24d725
commit c9ef2d3d59
19 changed files with 80 additions and 81 deletions

View File

@@ -168,11 +168,11 @@ function fluidd_status(){
fi fi
done done
if [ "$fcount" == "${#fluidd_data[*]}" ]; then if [ "$fcount" == "${#fluidd_data[*]}" ]; then
FLUIDD_STATUS="${green}Installed!${default} " FLUIDD_STATUS="${green}Installed!${white} "
elif [ "$fcount" == 0 ]; then elif [ "$fcount" == 0 ]; then
FLUIDD_STATUS="${red}Not installed!${default} " FLUIDD_STATUS="${red}Not installed!${white} "
else else
FLUIDD_STATUS="${yellow}Incomplete!${default} " FLUIDD_STATUS="${yellow}Incomplete!${white} "
fi fi
} }

View File

@@ -153,11 +153,11 @@ function klipperscreen_status(){
fi fi
done done
if [ "${klsccount}" == "${#klipperscreen_data[*]}" ]; then if [ "${klsccount}" == "${#klipperscreen_data[*]}" ]; then
KLIPPERSCREEN_STATUS="${green}Installed!${default} " KLIPPERSCREEN_STATUS="${green}Installed!${white} "
elif [ "${klsccount}" == 0 ]; then elif [ "${klsccount}" == 0 ]; then
KLIPPERSCREEN_STATUS="${red}Not installed!${default} " KLIPPERSCREEN_STATUS="${red}Not installed!${white} "
else else
KLIPPERSCREEN_STATUS="${yellow}Incomplete!${default} " KLIPPERSCREEN_STATUS="${yellow}Incomplete!${white} "
fi fi
} }
@@ -177,13 +177,13 @@ function compare_klipperscreen_versions(){
unset KLIPPERSCREEN_UPDATE_AVAIL unset KLIPPERSCREEN_UPDATE_AVAIL
read_klipperscreen_versions read_klipperscreen_versions
if [ "${LOCAL_KLIPPERSCREEN_COMMIT}" != "${REMOTE_KLIPPERSCREEN_COMMIT}" ]; then if [ "${LOCAL_KLIPPERSCREEN_COMMIT}" != "${REMOTE_KLIPPERSCREEN_COMMIT}" ]; then
LOCAL_KLIPPERSCREEN_COMMIT="${yellow}$(printf "%-12s" "${LOCAL_KLIPPERSCREEN_COMMIT}")${default}" LOCAL_KLIPPERSCREEN_COMMIT="${yellow}$(printf "%-12s" "${LOCAL_KLIPPERSCREEN_COMMIT}")${white}"
REMOTE_KLIPPERSCREEN_COMMIT="${green}$(printf "%-12s" "${REMOTE_KLIPPERSCREEN_COMMIT}")${default}" REMOTE_KLIPPERSCREEN_COMMIT="${green}$(printf "%-12s" "${REMOTE_KLIPPERSCREEN_COMMIT}")${white}"
KLIPPERSCREEN_UPDATE_AVAIL="true" KLIPPERSCREEN_UPDATE_AVAIL="true"
update_arr+=(update_klipperscreen) update_arr+=(update_klipperscreen)
else else
LOCAL_KLIPPERSCREEN_COMMIT="${green}$(printf "%-12s" "${LOCAL_KLIPPERSCREEN_COMMIT}")${default}" LOCAL_KLIPPERSCREEN_COMMIT="${green}$(printf "%-12s" "${LOCAL_KLIPPERSCREEN_COMMIT}")${white}"
REMOTE_KLIPPERSCREEN_COMMIT="${green}$(printf "%-12s" "${REMOTE_KLIPPERSCREEN_COMMIT}")${default}" REMOTE_KLIPPERSCREEN_COMMIT="${green}$(printf "%-12s" "${REMOTE_KLIPPERSCREEN_COMMIT}")${white}"
KLIPPERSCREEN_UPDATE_AVAIL="false" KLIPPERSCREEN_UPDATE_AVAIL="false"
fi fi
} }

View File

@@ -155,7 +155,7 @@ function get_user_selection_mjpg-streamer(){
top_border top_border
echo -e "| Install MJGP-Streamer for webcam support? |" echo -e "| Install MJGP-Streamer for webcam support? |"
bottom_border bottom_border
read -p "${cyan}###### Install MJPG-Streamer? (Y/n):${default} " yn read -p "${cyan}###### Install MJPG-Streamer? (Y/n):${white} " yn
case "${yn}" in case "${yn}" in
Y|y|Yes|yes|"") Y|y|Yes|yes|"")
echo -e "###### > Yes" echo -e "###### > Yes"

View File

@@ -129,11 +129,11 @@ function MoonrakerTelegramBot_status(){
fi fi
done done
if [ "${mtbcount}" == "${#MoonrakerTelegramBot_data[*]}" ]; then if [ "${mtbcount}" == "${#MoonrakerTelegramBot_data[*]}" ]; then
MOONRAKER_TELEGRAM_BOT_STATUS="${green}Installed!${default} " MOONRAKER_TELEGRAM_BOT_STATUS="${green}Installed!${white} "
elif [ "${mtbcount}" == 0 ]; then elif [ "${mtbcount}" == 0 ]; then
MOONRAKER_TELEGRAM_BOT_STATUS="${red}Not installed!${default} " MOONRAKER_TELEGRAM_BOT_STATUS="${red}Not installed!${white} "
else else
MOONRAKER_TELEGRAM_BOT_STATUS="${yellow}Incomplete!${default} " MOONRAKER_TELEGRAM_BOT_STATUS="${yellow}Incomplete!${white} "
fi fi
} }
@@ -153,13 +153,13 @@ function compare_MoonrakerTelegramBot_versions(){
unset MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL unset MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL
read_MoonrakerTelegramBot_versions read_MoonrakerTelegramBot_versions
if [ "${LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT}" != "${REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT}" ]; then if [ "${LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT}" != "${REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT}" ]; then
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT="${yellow}$(printf "%-12s" "${LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT}")${default}" LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT="${yellow}$(printf "%-12s" "${LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT}")${white}"
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "${REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT}")${default}" REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "${REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT}")${white}"
# add moonraker telegram bot to the update all array for the update all function in the updater # add moonraker telegram bot to the update all array for the update all function in the updater
MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL="true" && update_arr+=(update_MoonrakerTelegramBot) MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL="true" && update_arr+=(update_MoonrakerTelegramBot)
else else
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "${LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT}")${default}" LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "${LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT}")${white}"
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "${REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT}")${default}" REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "${REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT}")${white}"
MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL="false" MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL="false"
fi fi
} }

View File

@@ -63,9 +63,9 @@ function moonraker_setup_dialog(){
top_border top_border
if [ -f "${INITD}/klipper" ] || [ -f "${SYSTEMD}/klipper.service" ]; then if [ -f "${INITD}/klipper" ] || [ -f "${SYSTEMD}/klipper.service" ]; then
printf "|${green}%-55s${default}|\n" " 1 Klipper instance was found!" printf "|${green}%-55s${white}|\n" " 1 Klipper instance was found!"
elif [ "$(klipper_systemd | wc -w)" -gt 1 ]; then elif [ "$(klipper_systemd | wc -w)" -gt 1 ]; then
printf "|${green}%-55s${default}|\n" " $(klipper_systemd | wc -w) Klipper instances were found!" printf "|${green}%-55s${white}|\n" " $(klipper_systemd | wc -w) Klipper instances were found!"
else else
echo -e "| ${yellow}INFO: No existing Klipper installation found!${default} |" echo -e "| ${yellow}INFO: No existing Klipper installation found!${default} |"
fi fi

View File

@@ -80,7 +80,7 @@ function create_custom_hostname(){
echo -e "| browsing to: http://my-printer.local |" echo -e "| browsing to: http://my-printer.local |"
bottom_border bottom_border
while true; do while true; do
read -p "${cyan}###### Do you want to change the hostname? (y/N):${default} " yn read -p "${cyan}###### Do you want to change the hostname? (y/N):${white} " yn
case "$yn" in case "$yn" in
Y|y|Yes|yes) Y|y|Yes|yes)
user_input_hostname user_input_hostname
@@ -99,18 +99,18 @@ function user_input_hostname(){
unset HOSTENAME_CONFIRM unset HOSTENAME_CONFIRM
echo echo
top_border top_border
echo -e "| ${green}Allowed characters: a-z, 0-9 and single '-'${default} |" echo -e "| ${green}Allowed characters: a-z, 0-9 and single '-'${white} |"
echo -e "| ${red}No special characters allowed!${default} |" echo -e "| ${red}No special characters allowed!${white} |"
echo -e "| ${red}No leading or trailing '-' allowed!${default} |" echo -e "| ${red}No leading or trailing '-' allowed!${white} |"
bottom_border bottom_border
while true; do while true; do
read -p "${cyan}###### Please set the new hostname:${default} " NEW_HOSTNAME read -p "${cyan}###### Please set the new hostname:${white} " NEW_HOSTNAME
if [[ $NEW_HOSTNAME =~ ^[^\-\_]+([0-9a-z]\-{0,1})+[^\-\_]+$ ]]; then if [[ $NEW_HOSTNAME =~ ^[^\-\_]+([0-9a-z]\-{0,1})+[^\-\_]+$ ]]; then
ok_msg "'$NEW_HOSTNAME' is a valid hostname!" ok_msg "'$NEW_HOSTNAME' is a valid hostname!"
HOSTNAME_VALID="true" HOSTNAME_VALID="true"
while true; do while true; do
echo echo
read -p "${cyan}###### Do you want '$NEW_HOSTNAME' to be the new hostname? (Y/n):${default} " yn read -p "${cyan}###### Do you want '$NEW_HOSTNAME' to be the new hostname? (Y/n):${white} " yn
case "$yn" in case "$yn" in
Y|y|Yes|yes|"") Y|y|Yes|yes|"")
echo -e "###### > Yes" echo -e "###### > Yes"
@@ -118,7 +118,7 @@ function user_input_hostname(){
break;; break;;
N|n|No|no) N|n|No|no)
echo -e "###### > No" echo -e "###### > No"
echo -e "${red}Skip hostname change ...${default}" echo -e "${red}Skip hostname change ...${white}"
HOSTENAME_CONFIRM="false" HOSTENAME_CONFIRM="false"
break;; break;;
*) *)

View File

@@ -196,7 +196,7 @@ function process_services_dialog(){
while true; do while true; do
echo echo
top_border top_border
echo -e "| ${red}Possibly disruptive/incompatible services found!${default} |" echo -e "| ${red}Possibly disruptive/incompatible services found!${white} |"
hr hr
if [ "${HAPROXY_FOUND}" = "true" ]; then if [ "${HAPROXY_FOUND}" = "true" ]; then
echo -e "| ● haproxy |" echo -e "| ● haproxy |"
@@ -213,9 +213,9 @@ function process_services_dialog(){
echo -e "| |" echo -e "| |"
echo -e "| 1) Remove packages (recommend) |" echo -e "| 1) Remove packages (recommend) |"
echo -e "| 2) Disable only (may cause issues) |" echo -e "| 2) Disable only (may cause issues) |"
echo -e "| ${red}3) Skip this step (not recommended)${default} |" echo -e "| ${red}3) Skip this step (not recommended)${white} |"
bottom_border bottom_border
read -p "${cyan}###### Please choose:${default} " action read -p "${cyan}###### Please choose:${white} " action
case "${action}" in case "${action}" in
1) 1)
echo -e "###### > Remove packages" echo -e "###### > Remove packages"

View File

@@ -41,7 +41,7 @@ octoprint_setup_dialog(){
echo -e "| You need one OctoPrint instance per Klipper instance. | " echo -e "| You need one OctoPrint instance per Klipper instance. | "
bottom_border bottom_border
echo echo
read -p "${cyan}###### Create $INSTANCE_COUNT OctoPrint instances? (Y/n):${default} " yn read -p "${cyan}###### Create $INSTANCE_COUNT OctoPrint instances? (Y/n):${white} " yn
case "$yn" in case "$yn" in
Y|y|Yes|yes|"") Y|y|Yes|yes|"")
echo -e "###### > Yes" echo -e "###### > Yes"

View File

@@ -35,15 +35,15 @@ load_klipper_state(){
PREVIOUS_COMMIT_DATE=$(git show -s --format=%cd --date=short $PREVIOUS_COMMIT) PREVIOUS_COMMIT_DATE=$(git show -s --format=%cd --date=short $PREVIOUS_COMMIT)
fi fi
if [ "$PREVIOUS_COMMIT" = "0" ]; then if [ "$PREVIOUS_COMMIT" = "0" ]; then
CURR_UI=$(echo -e "${green}$CURRENT_COMMIT from $CURRENT_COMMIT_DATE${default}") CURR_UI=$(echo -e "${green}$CURRENT_COMMIT from $CURRENT_COMMIT_DATE${white}")
PREV_UI=$(echo -e "${red}None${default} ") PREV_UI=$(echo -e "${red}None${white} ")
else else
if [ "$CURRENT_COMMIT" = "$PREVIOUS_COMMIT" ]; then if [ "$CURRENT_COMMIT" = "$PREVIOUS_COMMIT" ]; then
CURR_UI=$(echo -e "${green}$CURRENT_COMMIT from $CURRENT_COMMIT_DATE${default}") CURR_UI=$(echo -e "${green}$CURRENT_COMMIT from $CURRENT_COMMIT_DATE${white}")
PREV_UI=$(echo -e "${green}$PREVIOUS_COMMIT from $PREVIOUS_COMMIT_DATE${default}") PREV_UI=$(echo -e "${green}$PREVIOUS_COMMIT from $PREVIOUS_COMMIT_DATE${white}")
else else
CURR_UI=$(echo -e "${yellow}$CURRENT_COMMIT from $CURRENT_COMMIT_DATE${default}") CURR_UI=$(echo -e "${yellow}$CURRENT_COMMIT from $CURRENT_COMMIT_DATE${white}")
PREV_UI=$(echo -e "${yellow}$PREVIOUS_COMMIT from $PREVIOUS_COMMIT_DATE${default}") PREV_UI=$(echo -e "${yellow}$PREVIOUS_COMMIT from $PREVIOUS_COMMIT_DATE${white}")
fi fi
fi fi
rollback_ui rollback_ui
@@ -59,7 +59,7 @@ rollback_ui(){
echo -e "| used commit from which you have updated. | " echo -e "| used commit from which you have updated. | "
bottom_border bottom_border
top_border top_border
echo -e "| Active branch: ${green}$PRINT_BRANCH${default} | " echo -e "| Active branch: ${green}$PRINT_BRANCH${white} | "
hr hr
echo -e "| Currently on commit: | " echo -e "| Currently on commit: | "
echo -e "| $CURR_UI | " echo -e "| $CURR_UI | "
@@ -74,7 +74,7 @@ rollback_klipper(){
while true; do while true; do
echo -e "${cyan}" echo -e "${cyan}"
read -p "###### Do you want to rollback to $PREVIOUS_COMMIT? (Y/n): " yn read -p "###### Do you want to rollback to $PREVIOUS_COMMIT? (Y/n): " yn
echo -e "${default}" echo -e "${white}"
case "$yn" in case "$yn" in
Y|y|Yes|yes|"") Y|y|Yes|yes|"")
clear clear
@@ -95,7 +95,7 @@ rollback_klipper(){
while true; do while true; do
echo -e "${cyan}" echo -e "${cyan}"
read -p "Perform action: " action; echo read -p "Perform action: " action; echo
echo -e "${default}" echo -e "${white}"
case "$action" in case "$action" in
B|b) B|b)
clear; advanced_menu; break;; clear; advanced_menu; break;;

View File

@@ -3,10 +3,10 @@ check_system_updates(){
if [ ! -z "$SYS_UPDATE" ]; then if [ ! -z "$SYS_UPDATE" ]; then
# add system updates to the update all array for the update all function in the updater # add system updates to the update all array for the update all function in the updater
SYS_UPDATE_AVAIL="true" && update_arr+=(update_system) SYS_UPDATE_AVAIL="true" && update_arr+=(update_system)
DISPLAY_SYS_UPDATE="${yellow}System upgrade available!${default}" DISPLAY_SYS_UPDATE="${yellow}System upgrade available!${white}"
else else
SYS_UPDATE_AVAIL="false" SYS_UPDATE_AVAIL="false"
DISPLAY_SYS_UPDATE="${green}System up to date! ${default}" DISPLAY_SYS_UPDATE="${green}System up to date! ${white}"
fi fi
} }

View File

@@ -91,7 +91,7 @@ switch_ui(){
echo -e "| $(title_msg "~~~~~~~~~ [ Switch Klipper Branch ] ~~~~~~~~~") |" echo -e "| $(title_msg "~~~~~~~~~ [ Switch Klipper Branch ] ~~~~~~~~~") |"
bottom_border bottom_border
echo echo
echo -e " $(title_msg "Active Branch: ")${green}$GET_BRANCH${default}" echo -e " $(title_msg "Active Branch: ")${green}$GET_BRANCH${white}"
echo echo
top_border top_border
echo -e "| | " echo -e "| | "
@@ -109,7 +109,7 @@ switch_menu(){
read_branch read_branch
do_action "" "switch_ui" do_action "" "switch_ui"
while true; do while true; do
read -p "${cyan}Perform action:${default} " action; echo read -p "${cyan}Perform action:${white} " action; echo
case "$action" in case "$action" in
1) 1)
clear clear

View File

@@ -15,7 +15,7 @@ backup_ui(){
top_border top_border
echo -e "| $(title_msg "~~~~~~~~~~~~~~ [ Backup Menu ] ~~~~~~~~~~~~~~") | " echo -e "| $(title_msg "~~~~~~~~~~~~~~ [ Backup Menu ] ~~~~~~~~~~~~~~") | "
hr hr
echo -e "| ${yellow}Backup location: ~/kiauh-backups${default} | " echo -e "| ${yellow}Backup location: ~/kiauh-backups${white} | "
hr hr
echo -e "| Configuration folder: | Klipper Webinterface: | " echo -e "| Configuration folder: | Klipper Webinterface: | "
echo -e "| 0) [Klipper configs] | 4) [Mainsail] | " echo -e "| 0) [Klipper configs] | 4) [Mainsail] | "
@@ -33,7 +33,7 @@ backup_ui(){
backup_menu(){ backup_menu(){
do_action "" "backup_ui" do_action "" "backup_ui"
while true; do while true; do
read -p "${cyan}Perform action:${default} " action; echo read -p "${cyan}Perform action:${white} " action; echo
case "$action" in case "$action" in
0) 0)
do_action "backup_klipper_config_dir" "backup_ui";; do_action "backup_klipper_config_dir" "backup_ui";;

View File

@@ -30,19 +30,19 @@ hr(){
quit_footer(){ quit_footer(){
hr hr
echo -e "| ${red}Q) Quit${default} |" echo -e "| ${red}Q) Quit${white} |"
bottom_border bottom_border
} }
back_footer(){ back_footer(){
hr hr
echo -e "| ${green}B) « Back${default} |" echo -e "| ${green}B) « Back${white} |"
bottom_border bottom_border
} }
back_help_footer(){ back_help_footer(){
hr hr
echo -e "| ${green}B) « Back${default} | ${yellow}H) Help [?]${default} |" echo -e "| ${green}B) « Back${white} | ${yellow}H) Help [?]${white} |"
bottom_border bottom_border
} }

View File

@@ -35,7 +35,7 @@ install_ui(){
install_menu(){ install_menu(){
do_action "" "install_ui" do_action "" "install_ui"
while true; do while true; do
read -p "${cyan}Perform action:${default} " action; echo read -p "${cyan}Perform action:${white} " action; echo
case "$action" in case "$action" in
1) 1)
do_action "klipper_setup_dialog" "install_ui";; do_action "klipper_setup_dialog" "install_ui";;

View File

@@ -70,7 +70,6 @@ main_menu(){
octoprint_status octoprint_status
klipperscreen_status klipperscreen_status
MoonrakerTelegramBot_status MoonrakerTelegramBot_status
print_msg && clear_msg
main_ui main_ui
while true; do while true; do
read -p "${cyan}Perform action:${white} " action; echo read -p "${cyan}Perform action:${white} " action; echo

View File

@@ -16,20 +16,20 @@ settings_ui(){
top_border top_border
echo -e "| $(title_msg "~~~~~~~~~~~~ [ KIAUH Settings ] ~~~~~~~~~~~~~") | " echo -e "| $(title_msg "~~~~~~~~~~~~ [ KIAUH Settings ] ~~~~~~~~~~~~~") | "
hr hr
echo -e "| ${red}Caution:${default} | " echo -e "| ${red}Caution:${white} | "
echo -e "| When you change 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 change the folder during printing!${default} | " echo -e "| ${red}DO NOT change the folder during printing!${white} | "
hr hr
blank_line blank_line
echo -e "| ${cyan}● Current Klipper config folder:${default} | " echo -e "| ${cyan}● Current Klipper config folder:${white} | "
printf "|%-55s|\n" " $klipper_cfg_loc" printf "|%-55s|\n" " $klipper_cfg_loc"
blank_line blank_line
hr hr
if [ -z $klipper_cfg_loc ]; then if [ -z $klipper_cfg_loc ]; then
echo -e "| ${red}N/A) Install Klipper with KIAUH first to unlock!${default} | " echo -e "| ${red}N/A) Install Klipper with KIAUH first to unlock!${white} | "
else else
echo -e "| 1) Change config folder | " echo -e "| 1) Change config folder | "
fi fi
@@ -39,7 +39,7 @@ settings_ui(){
settings_menu(){ settings_menu(){
do_action "" "settings_ui" do_action "" "settings_ui"
while true; do while true; do
read -p "${cyan}Perform action:${default} " action; echo read -p "${cyan}Perform action:${white} " action; echo
case "$action" in case "$action" in
1) 1)
if [ ! -z $klipper_cfg_loc ]; then if [ ! -z $klipper_cfg_loc ]; then

View File

@@ -8,32 +8,32 @@ update_all(){
top_border top_border
echo -e "| The following installations will be updated: |" echo -e "| The following installations will be updated: |"
if [ "$KLIPPER_UPDATE_AVAIL" = "true" ]; then if [ "$KLIPPER_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● Klipper${default} |" echo -e "| ${cyan}● Klipper${white} |"
fi fi
if [ "$MOONRAKER_UPDATE_AVAIL" = "true" ]; then if [ "$MOONRAKER_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● Moonraker${default} |" echo -e "| ${cyan}● Moonraker${white} |"
fi fi
if [ "$MAINSAIL_UPDATE_AVAIL" = "true" ]; then if [ "$MAINSAIL_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● Mainsail${default} |" echo -e "| ${cyan}● Mainsail${white} |"
fi fi
if [ "$FLUIDD_UPDATE_AVAIL" = "true" ]; then if [ "$FLUIDD_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● Fluidd${default} |" echo -e "| ${cyan}● Fluidd${white} |"
fi fi
if [ "$KLIPPERSCREEN_UPDATE_AVAIL" = "true" ]; then if [ "$KLIPPERSCREEN_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● KlipperScreen${default} |" echo -e "| ${cyan}● KlipperScreen${white} |"
fi fi
if [ "$PGC_UPDATE_AVAIL" = "true" ]; then if [ "$PGC_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● PrettyGCode for Klipper${default} |" echo -e "| ${cyan}● PrettyGCode for Klipper${white} |"
fi fi
if [ "$MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL" = "true" ]; then if [ "$MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● MoonrakerTelegramBot${default} |" echo -e "| ${cyan}● MoonrakerTelegramBot${white} |"
fi fi
if [ "$SYS_UPDATE_AVAIL" = "true" ]; then if [ "$SYS_UPDATE_AVAIL" = "true" ]; then
echo -e "| ${cyan}● System${default} |" echo -e "| ${cyan}● System${white} |"
fi fi
bottom_border bottom_border
if [ "${#update_arr[@]}" != "0" ]; then if [ "${#update_arr[@]}" != "0" ]; then
read -p "${cyan}###### Do you want to proceed? (Y/n):${default} " yn read -p "${cyan}###### Do you want to proceed? (Y/n):${white} " yn
case "$yn" in case "$yn" in
Y|y|Yes|yes|"") Y|y|Yes|yes|"")
for update in ${update_arr[@]} for update in ${update_arr[@]}

View File

@@ -1,21 +1,21 @@
accept_upload_conditions(){ accept_upload_conditions(){
while true; do while true; do
top_border top_border
echo -e "| ${red}~~~~~~~~~~~ [ Upload Agreement ] ~~~~~~~~~~~~${default} |" echo -e "| ${red}~~~~~~~~~~~ [ Upload Agreement ] ~~~~~~~~~~~~${white} |"
hr hr
echo -e "| The following function will help to quickly upload |" echo -e "| The following function will help to quickly upload |"
echo -e "| logs for debugging purposes. With confirming this |" echo -e "| logs for debugging purposes. With confirming this |"
echo -e "| dialog, you agree that during that process your logs |" echo -e "| dialog, you agree that during that process your logs |"
echo -e "| will be uploaded to: ${yellow}http://paste.c-net.org/${default} |" echo -e "| will be uploaded to: ${yellow}http://paste.c-net.org/${white} |"
hr hr
echo -e "| ${red}PLEASE NOTE:${default} |" echo -e "| ${red}PLEASE NOTE:${white} |"
echo -e "| Be aware that logs can contain network information, |" echo -e "| Be aware that logs can contain network information, |"
echo -e "| private data like usernames, filenames, or other |" echo -e "| private data like usernames, filenames, or other |"
echo -e "| information you may not want to make public. |" echo -e "| information you may not want to make public. |"
blank_line blank_line
echo -e "| Do ${red}NOT${default} use this function if you don't agree! |" echo -e "| Do ${red}NOT${white} use this function if you don't agree! |"
bottom_border bottom_border
read -p "${cyan}Do you accept? (Y/n):${default} " yn read -p "${cyan}Do you accept? (Y/n):${white} " yn
case "$yn" in case "$yn" in
Y|y|Yes|yes|"") Y|y|Yes|yes|"")
sed -i "/logupload_accepted=/s/false/true/" $INI_FILE sed -i "/logupload_accepted=/s/false/true/" $INI_FILE
@@ -59,7 +59,7 @@ upload_selection(){
### draw interface ### draw interface
i=0 i=0
top_border top_border
echo -e "| ${yellow}~~~~~~~~~~~~~~~ [ Log Upload ] ~~~~~~~~~~~~~~${default} |" echo -e "| ${yellow}~~~~~~~~~~~~~~~ [ Log Upload ] ~~~~~~~~~~~~~~${white} |"
hr hr
echo -e "| You can choose the following files for uploading: |" echo -e "| You can choose the following files for uploading: |"
for log in ${logfiles[@]}; do for log in ${logfiles[@]}; do
@@ -68,7 +68,7 @@ upload_selection(){
done done
back_footer back_footer
while true; do while true; do
read -p "${cyan}Please select:${default} " choice read -p "${cyan}Please select:${white} " choice
if [ $choice = "b" ] || [ $choice = "B" ]; then if [ $choice = "b" ] || [ $choice = "B" ]; then
clear && main_menu && break clear && main_menu && break
elif [ $choice -le ${#logfiles[@]} ]; then elif [ $choice -le ${#logfiles[@]} ]; then
@@ -88,7 +88,7 @@ upload_log(){
status_msg "Uploading $1 ..." status_msg "Uploading $1 ..."
LINK=$(curl -s --upload-file $1 'http://paste.c-net.org/') LINK=$(curl -s --upload-file $1 'http://paste.c-net.org/')
[ ! -z "$LINK" ] && ok_msg "$1 upload successfull!" [ ! -z "$LINK" ] && ok_msg "$1 upload successfull!"
echo -e "\n${cyan}###### Here is your link:${default}" echo -e "\n${cyan}###### Here is your link:${white}"
echo -e ">>>>>> $LINK\n" echo -e ">>>>>> $LINK\n"
unset LINK unset LINK
else else

View File

@@ -119,19 +119,19 @@ function read_kiauh_ini(){
function init_ini(){ function init_ini(){
### remove pre-version 4 ini files ### remove pre-version 4 ini files
if [ -f "${INI_FILE}" ] && ! grep -Eq "^KIAUH v4\.0\.0$" "${INI_FILE}"; then if [ -f "${INI_FILE}" ] && ! grep -Eq "^# KIAUH v4\.0\.0$" "${INI_FILE}"; then
rm "${INI_FILE}" rm "${INI_FILE}"
fi fi
### initialize ini file ### initialize ini file
if [ ! -f "${INI_FILE}" ]; then if [ ! -f "${INI_FILE}" ]; then
{ {
echo -e "File creation date: $(date)" echo -e "# File creation date: $(date)"
echo -e "#=================================================#" echo -e "#=================================================#"
echo -e "# KIAUH - Klipper Installation And Update Helper #" echo -e "# KIAUH - Klipper Installation And Update Helper #"
echo -e "# https://github.com/th33xitus/kiauh #" echo -e "# https://github.com/th33xitus/kiauh #"
echo -e "# DO NOT edit this file! #" echo -e "# DO NOT edit this file! #"
echo -e "#=================================================#" echo -e "#=================================================#"
echo -e "KIAUH v4.0.0" echo -e "# KIAUH v4.0.0"
} >> "${INI_FILE}" } >> "${INI_FILE}"
fi fi
if ! grep -Eq "^backup_before_update=." "${INI_FILE}"; then if ! grep -Eq "^backup_before_update=." "${INI_FILE}"; then
@@ -487,16 +487,16 @@ function get_user_selection_kiauh_macros(){
echo -e "| fully functional and working. |" echo -e "| fully functional and working. |"
blank_line blank_line
echo -e "| Those macros are: |" echo -e "| Those macros are: |"
echo -e "| ${cyan}● [gcode_macro PAUSE]${default} |" echo -e "| ${cyan}● [gcode_macro PAUSE]${white} |"
echo -e "| ${cyan}● [gcode_macro RESUME]${default} |" echo -e "| ${cyan}● [gcode_macro RESUME]${white} |"
echo -e "| ${cyan}● [gcode_macro CANCEL_PRINT]${default} |" echo -e "| ${cyan}● [gcode_macro CANCEL_PRINT]${white} |"
blank_line blank_line
echo -e "| If you already have these macros in your config file |" echo -e "| If you already have these macros in your config file |"
echo -e "| you can skip this step and choose 'no'. |" echo -e "| you can skip this step and choose 'no'. |"
echo -e "| Otherwise you should consider to answer with 'yes' to |" echo -e "| Otherwise you should consider to answer with 'yes' to |"
echo -e "| add the recommended example macros to your config. |" echo -e "| add the recommended example macros to your config. |"
bottom_border bottom_border
read -p "${cyan}###### Add the recommended macros? (Y/n):${default} " yn read -p "${cyan}###### Add the recommended macros? (Y/n):${white} " yn
case "${yn}" in case "${yn}" in
Y|y|Yes|yes|"") Y|y|Yes|yes|"")
echo -e "###### > Yes" echo -e "###### > Yes"
@@ -551,7 +551,7 @@ function process_octoprint_dialog(){
while true; do while true; do
echo echo
top_border top_border
echo -e "| ${red}!!! WARNING - OctoPrint service found !!!${default} |" echo -e "| ${red}!!! WARNING - OctoPrint service found !!!${white} |"
hr hr
echo -e "| You might consider disabling the OctoPrint service, |" echo -e "| You might consider disabling the OctoPrint service, |"
echo -e "| since an active OctoPrint service may lead to unex- |" echo -e "| since an active OctoPrint service may lead to unex- |"