diff --git a/scripts/flash_klipper.sh b/scripts/flash_klipper.sh index 1a76cc5..21e9258 100644 --- a/scripts/flash_klipper.sh +++ b/scripts/flash_klipper.sh @@ -222,7 +222,7 @@ function start_flash_sd() { else printf "| ${i}) %-49s|\n" "${board_list[${i}]}" fi - i=$((i + 1)) + i=$(( i + 1 )) done quit_footer diff --git a/scripts/klipper.sh b/scripts/klipper.sh index fcc36c6..1199429 100644 --- a/scripts/klipper.sh +++ b/scripts/klipper.sh @@ -259,8 +259,8 @@ function klipper_setup() { ### confirm message local confirm="" - (( instance_arr[0] == 1)) && confirm="Klipper has been set up!" - (( instance_arr[0] > 1)) && confirm="${instance_arr[0]} Klipper instances have been set up!" + (( instance_arr[0] == 1 )) && confirm="Klipper has been set up!" + (( instance_arr[0] > 1 )) && confirm="${instance_arr[0]} Klipper instances have been set up!" print_confirm "${confirm}" && return } @@ -515,16 +515,16 @@ function get_klipper_status() { ### count+1 for each found data-item from array local filecount=0 for data in "${data_arr[@]}"; do - [[ -e ${data} ]] && filecount=$(("${filecount}" + 1)) + [[ -e ${data} ]] && filecount=$(( filecount + 1 )) done - if (( filecount == ${#data_arr[*]})); then + if (( filecount == ${#data_arr[*]} )); then if (( py_ver == 3 )); then status="Installed: ${sf_count}(py${py_ver})" else status="Installed: ${sf_count}" fi - elif ((filecount == 0)); then + elif (( filecount == 0 )); then status="Not installed!" else status="Incomplete!" diff --git a/scripts/mainsail.sh b/scripts/mainsail.sh index 14bec22..f70ba9c 100644 --- a/scripts/mainsail.sh +++ b/scripts/mainsail.sh @@ -356,6 +356,7 @@ function ms_theme_installer_menu() { theme_repo+=("${col4}") done <<< "${theme_list}" + local option while true; do read -p "${cyan}Install theme:${white} " option if (( option > 0 && option < ${#theme_name[@]} )); then diff --git a/scripts/moonraker-telegram-bot.sh b/scripts/moonraker-telegram-bot.sh index bea0165..dc3a74d 100644 --- a/scripts/moonraker-telegram-bot.sh +++ b/scripts/moonraker-telegram-bot.sh @@ -209,7 +209,7 @@ function create_telegram_conf() { elif (( telegram_bot_count > 1 )); then local j=0 re="^[1-9][0-9]*$" - for ((i=1; i <= telegram_bot_count; i++ )); do + for (( i=1; i <= telegram_bot_count; i++ )); do ### overwrite config folder if name is only a number if [[ ${names[j]} =~ ${re} ]]; then cfg_dir="${KLIPPER_CONFIG}/printer_${names[${j}]}" @@ -219,7 +219,7 @@ function create_telegram_conf() { ### write multi instance config write_telegram_conf "${cfg_dir}" "${cfg}" "${log}" - j=$((j+1)) + j=$(( j + 1 )) done && unset j else diff --git a/scripts/octoprint.sh b/scripts/octoprint.sh index 3641697..f3cf086 100644 --- a/scripts/octoprint.sh +++ b/scripts/octoprint.sh @@ -391,7 +391,7 @@ function get_octoprint_status() { if (( sf_count == 0 )) && (( env_count == 0 )) && (( dir_count == 0 )); then status="Not installed!" - elif (( sf_count == env_count)) && (( sf_count == dir_count )); then + elif (( sf_count == env_count )) && (( sf_count == dir_count )); then status="Installed: ${sf_count}" else status="Incomplete!" diff --git a/scripts/rollback.sh b/scripts/rollback.sh index d4cb9fd..b2b54bc 100755 --- a/scripts/rollback.sh +++ b/scripts/rollback.sh @@ -65,7 +65,7 @@ function rollback_component() { local count while true; do read -p "${cyan}###### Revert this amount of commits:${white} " count - if [[ -n ${count} ]] && ((count > 0)); then + if [[ -n ${count} ]] && (( count > 0 )); then status_msg "Revert ${component^} by ${count} commits ..." cd "${HOME}/${component}" if git reset --hard HEAD~"${count}"; then