From c19acb1694e6957b0d4a8e5852c8db134a2bf6bd Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 4 Jun 2023 19:12:53 +0200 Subject: [PATCH 01/17] fix(mainsail/fluidd): fall back to latest stable url if fetching tags fails (#348) --- scripts/fluidd.sh | 33 +++++++++++++++++---------------- scripts/mainsail.sh | 33 +++++++++++++++++---------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/scripts/fluidd.sh b/scripts/fluidd.sh index 42fda1d..345a1c4 100644 --- a/scripts/fluidd.sh +++ b/scripts/fluidd.sh @@ -341,27 +341,28 @@ function compare_fluidd_versions() { #================================================# function get_fluidd_download_url() { - local fl_tags tags latest_tag latest_url stable_tag stable_url url + local releases_by_tag tags tag unstable_url url - fl_tags="https://api.github.com/repos/fluidd-core/fluidd/tags" - tags=$(curl -s "${fl_tags}" | grep "name" | cut -d'"' -f4) - - ### latest download url including pre-releases (alpha, beta, rc) - latest_tag=$(echo "${tags}" | head -1) - latest_url="https://github.com/fluidd-core/fluidd/releases/download/${latest_tag}/fluidd.zip" - - ### get stable fluidd download url - stable_tag=$(echo "${tags}" | grep -E "^v([0-9]+\.?){3}$" | head -1) - stable_url="https://github.com/fluidd-core/fluidd/releases/download/${stable_tag}/fluidd.zip" + ### latest stable download url + url="https://github.com/fluidd-core/fluidd/releases/latest/download/fluidd.zip" read_kiauh_ini "${FUNCNAME[0]}" if [[ ${fluidd_install_unstable} == "true" ]]; then - url="${latest_url}" - echo "${url}" - else - url="${stable_url}" - echo "${url}" + releases_by_tag="https://api.github.com/repos/fluidd-core/fluidd/tags" + tags=$(curl -s "${releases_by_tag}" | grep "name" | cut -d'"' -f4) + tag=$(echo "${tags}" | head -1) + + ### latest unstable download url including pre-releases (alpha, beta, rc) + unstable_url="https://github.com/fluidd-core/fluidd/releases/download/${tag}/fluidd.zip" + + if [[ ${unstable_url} == *"download//"* ]]; then + warn_msg "Download URL broken! Falling back to URL of latest stable release!" + else + url=${unstable_url} + fi fi + + echo "${url}" } function fluidd_port_check() { diff --git a/scripts/mainsail.sh b/scripts/mainsail.sh index 0cdedfd..67fef87 100644 --- a/scripts/mainsail.sh +++ b/scripts/mainsail.sh @@ -511,27 +511,28 @@ function ms_theme_delete() { #================================================# function get_mainsail_download_url() { - local ms_tags tags latest_tag latest_url stable_tag stable_url url + local releases_by_tag tags tag unstable_url url - ms_tags="https://api.github.com/repos/mainsail-crew/mainsail/tags" - tags=$(curl -s "${ms_tags}" | grep "name" | cut -d'"' -f4) - - ### latest download url including pre-releases (alpha, beta, rc) - latest_tag=$(echo "${tags}" | head -1) - latest_url="https://github.com/mainsail-crew/mainsail/releases/download/${latest_tag}/mainsail.zip" - - ### get stable mainsail download url - stable_tag=$(echo "${tags}" | grep -E "^v([0-9]+\.?){3}$" | head -1) - stable_url="https://github.com/mainsail-crew/mainsail/releases/download/${stable_tag}/mainsail.zip" + ### latest stable download url + url="https://github.com/mainsail-crew/mainsail/releases/latest/download/mainsail.zip" read_kiauh_ini "${FUNCNAME[0]}" if [[ ${mainsail_install_unstable} == "true" ]]; then - url="${latest_url}" - echo "${url}" - else - url="${stable_url}" - echo "${url}" + releases_by_tag="https://api.github.com/repos/mainsail-crew/mainsail/tags" + tags=$(curl -s "${releases_by_tag}" | grep "name" | cut -d'"' -f4) + tag=$(echo "${tags}" | head -1) + + ### latest unstable download url including pre-releases (alpha, beta, rc) + unstable_url="https://github.com/mainsail-crew/mainsail/releases/download/${tag}/mainsail.zip" + + if [[ ${unstable_url} == *"download//"* ]]; then + warn_msg "Download URL broken! Falling back to URL of latest stable release!" + else + url=${unstable_url} + fi fi + + echo "${url}" } function mainsail_port_check() { -- 2.39.5 From 477f3ca72cd2b05c8b2ffaf085a07f9d66e13f1c Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sun, 4 Jun 2023 21:23:32 +0200 Subject: [PATCH 02/17] feat: flash DFU device in HID mode (#337) Co-authored-by: th33xitus --- scripts/flash_klipper.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/flash_klipper.sh b/scripts/flash_klipper.sh index 8ea0ab8..c281214 100644 --- a/scripts/flash_klipper.sh +++ b/scripts/flash_klipper.sh @@ -70,6 +70,7 @@ function select_mcu_connection() { echo -e "| How is the controller board connected to the host? |" echo -e "| 1) USB |" echo -e "| 2) UART |" + echo -e "| 3) USB (DFU mode) |" blank_line back_help_footer @@ -85,6 +86,10 @@ function select_mcu_connection() { status_msg "Identifying MCU possibly connected via UART ...\n" get_uart_id || true # continue even after exit code 1 break;; + 3) + status_msg "Identifying MCU connected via USB in DFU mode ...\n" + get_dfu_id || true # continue even after exit code 1 + break;; B|b) advanced_menu break;; @@ -329,6 +334,16 @@ function get_uart_id() { done } +function get_dfu_id() { + unset mcu_list + sleep 1 + mcus=$(lsusb | grep "DFU" | cut -d " " -f 6 2>/dev/null) + + for mcu in ${mcus}; do + mcu_list+=("${mcu}") + done +} + function show_flash_method_help() { top_border echo -e "| ~~~~~~~~ < ? > Help: Flash MCU < ? > ~~~~~~~~ |" @@ -406,4 +421,4 @@ function show_mcu_connection_help() { error_msg "Invalid command!";; esac done -} \ No newline at end of file +} -- 2.39.5 From bcbb185bd79afd8f81971253b2702ab4b703710a Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 4 Jun 2023 21:57:56 +0200 Subject: [PATCH 03/17] readme: update README.md also fixes #327 --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d662268..e75d00c 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ distributions based on Debian 11 Bullseye. Read the notes further down below in * **Step 1:** \ To download this script, it is necessary to have git installed. If you don't have git already installed, or if you are unsure, run the following command: ```shell -sudo apt-get install git -y +sudo apt-get update && sudo apt-get install git -y ``` * **Step 2:** \ @@ -178,3 +178,12 @@ prompt and confirm by hitting ENTER. * A big thank you to [lixxbox](https://github.com/lixxbox) for that awesome KIAUH-Logo! * Also, a big thank you to everyone who supported my work with a [Ko-fi](https://ko-fi.com/th33xitus) ! * Last but not least: Thank you to all contributors and members of the Klipper Community who like and share this project! + +
+ +

A special thank you to JetBrains for sponsoring this project with their incredible software!

+

+ + JetBrains Logo (Main) logo. + +

-- 2.39.5 From 0cd058320fcbb9a9eeff7f9cea6a0a038e443fe6 Mon Sep 17 00:00:00 2001 From: marbocub Date: Wed, 7 Jun 2023 04:09:47 +0900 Subject: [PATCH 04/17] feat: allow to install Mainsail/Fluidd without Moonraker (#347) Co-authored-by: th33xitus --- scripts/fluidd.sh | 22 ++++++++++++++++++---- scripts/mainsail.sh | 26 +++++++++++++++++++++----- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/scripts/fluidd.sh b/scripts/fluidd.sh index 345a1c4..5b3407c 100644 --- a/scripts/fluidd.sh +++ b/scripts/fluidd.sh @@ -16,10 +16,24 @@ set -e #===================================================# function install_fluidd() { - ### exit early if moonraker not found if [[ -z $(moonraker_systemd) ]]; then - local error="Moonraker not installed! Please install Moonraker first!" - print_error "${error}" && return + local error="Moonraker not installed! It's recommended to install Moonraker first!" + print_error "${error}" + while true; do + local yn + read -p "${cyan}###### Proceed to install Fluidd without installing Moonraker? (y/N):${white} " yn + case "${yn}" in + Y|y|Yes|yes) + select_msg "Yes" + break;; + N|n|No|no|"") + select_msg "No" + abort_msg "Exiting Fluidd setup ...\n" + return;; + *) + error_msg "Invalid Input!";; + esac + done fi ### checking dependencies @@ -30,7 +44,7 @@ function install_fluidd() { status_msg "Initializing Fluidd installation ..." ### first, we create a backup of the full klipper_config dir - safety first! - backup_klipper_config_dir + #backup_klipper_config_dir ### check for other enabled web interfaces unset SET_LISTEN_PORT diff --git a/scripts/mainsail.sh b/scripts/mainsail.sh index 67fef87..da220f7 100644 --- a/scripts/mainsail.sh +++ b/scripts/mainsail.sh @@ -16,10 +16,24 @@ set -e #===================================================# function install_mainsail() { - ### exit early if moonraker not found if [[ -z $(moonraker_systemd) ]]; then - local error="Moonraker not installed! Please install Moonraker first!" - print_error "${error}" && return + local error="Moonraker not installed! It's recommended to install Moonraker first!" + print_error "${error}" + while true; do + local yn + read -p "${cyan}###### Proceed to install Mainsail without installing Moonraker? (y/N):${white} " yn + case "${yn}" in + Y|y|Yes|yes) + select_msg "Yes" + break;; + N|n|No|no|"") + select_msg "No" + abort_msg "Exiting Mainsail setup ...\n" + return;; + *) + error_msg "Invalid Input!";; + esac + done fi ### checking dependencies @@ -157,6 +171,7 @@ function download_mainsail_macros() { } function download_mainsail() { + local services local url url=$(get_mainsail_download_url) @@ -179,8 +194,9 @@ function download_mainsail() { exit 1 fi - ### check for moonraker multi-instance and if multi-instance was found, enable mainsails remoteMode - if [[ $(moonraker_systemd | wc -w) -gt 1 ]]; then + ### check for moonraker multi-instance and if no-instance or multi-instance was found, enable mainsails remoteMode + services=$(moonraker_systemd) + if [[ ( -z "${services}" ) || ( $(echo "${services}" | wc -w) -gt 1 ) ]]; then enable_mainsail_remotemode fi } -- 2.39.5 From 7df3dd489fff51a5ac783ce2a6b570633ccd210a Mon Sep 17 00:00:00 2001 From: th33xitus Date: Wed, 7 Jun 2023 21:48:17 +0200 Subject: [PATCH 05/17] fix(mainsail/fluidd): show correct version number in update menu fixes #350 Signed-off-by: Dominik Willner --- scripts/fluidd.sh | 6 +++--- scripts/mainsail.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/fluidd.sh b/scripts/fluidd.sh index 5b3407c..c6f7ecd 100644 --- a/scripts/fluidd.sh +++ b/scripts/fluidd.sh @@ -327,9 +327,9 @@ function get_local_fluidd_version() { function get_remote_fluidd_version() { [[ ! $(dpkg-query -f'${Status}' --show curl 2>/dev/null) = *\ installed ]] && return - local version - version=$(get_fluidd_download_url | rev | cut -d"/" -f2 | rev) - echo "${version}" + local tags + tags=$(curl -s "https://api.github.com/repos/fluidd-core/fluidd/tags" | grep "name" | cut -d'"' -f4) + echo "${tags}" | head -1 } function compare_fluidd_versions() { diff --git a/scripts/mainsail.sh b/scripts/mainsail.sh index da220f7..7b052d5 100644 --- a/scripts/mainsail.sh +++ b/scripts/mainsail.sh @@ -334,9 +334,9 @@ function get_local_mainsail_version() { function get_remote_mainsail_version() { [[ ! $(dpkg-query -f'${Status}' --show curl 2>/dev/null) = *\ installed ]] && return - local version - version=$(get_mainsail_download_url | rev | cut -d"/" -f2 | rev) - echo "${version}" + local tags + tags=$(curl -s "https://api.github.com/repos/mainsail-crew/mainsail/tags" | grep "name" | cut -d'"' -f4) + echo "${tags}" | head -1 } function compare_mainsail_versions() { -- 2.39.5 From d97cca69a6bd2cca5c645ab5cb451428df435053 Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Sat, 3 Jun 2023 16:48:27 -0400 Subject: [PATCH 06/17] feat: update package lists only when stale (#334) --- scripts/crowsnest.sh | 14 +++++++++----- scripts/klipper.sh | 14 +++++++++----- scripts/moonraker-telegram-bot.sh | 14 +++++++++----- scripts/moonraker.sh | 14 +++++++++----- scripts/octoeverywhere.sh | 14 +++++++++----- scripts/utilities.sh | 29 ++++++++++++++++++++++++++--- 6 files changed, 71 insertions(+), 28 deletions(-) diff --git a/scripts/crowsnest.sh b/scripts/crowsnest.sh index cda3820..393f6ab 100644 --- a/scripts/crowsnest.sh +++ b/scripts/crowsnest.sh @@ -208,12 +208,16 @@ function install_crowsnest_dependencies() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info + ### Update system package info if lists > 3 days old status_msg "Updating package lists..." - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 + if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then + if ! sudo apt-get update --allow-releaseinfo-change; then + log_error "failure while updating package lists" + error_msg "Updating package lists failed!" + exit 1 + fi + else + status_msg "Package lists updated recently, skipping..." fi ### Install required packages diff --git a/scripts/klipper.sh b/scripts/klipper.sh index 66126b4..ca489fb 100644 --- a/scripts/klipper.sh +++ b/scripts/klipper.sh @@ -321,12 +321,16 @@ function install_klipper_packages() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info + ### Update system package info if lists > 3 days old status_msg "Updating package lists..." - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 + if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then + if ! sudo apt-get update --allow-releaseinfo-change; then + log_error "failure while updating package lists" + error_msg "Updating package lists failed!" + exit 1 + fi + else + status_msg "Package lists updated recently, skipping..." fi ### Install required packages diff --git a/scripts/moonraker-telegram-bot.sh b/scripts/moonraker-telegram-bot.sh index 7aab1e9..ee0520f 100644 --- a/scripts/moonraker-telegram-bot.sh +++ b/scripts/moonraker-telegram-bot.sh @@ -121,12 +121,16 @@ function install_telegram_bot_dependencies() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info + ### Update system package info if lists > 3 days old status_msg "Updating package lists..." - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 + if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then + if ! sudo apt-get update --allow-releaseinfo-change; then + log_error "failure while updating package lists" + error_msg "Updating package lists failed!" + exit 1 + fi + else + status_msg "Package lists updated recently, skipping..." fi ### Install required packages diff --git a/scripts/moonraker.sh b/scripts/moonraker.sh index 655e2d6..a2020bf 100644 --- a/scripts/moonraker.sh +++ b/scripts/moonraker.sh @@ -152,12 +152,16 @@ function install_moonraker_dependencies() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info + ### Update system package info if lists > 3 days old status_msg "Updating package lists..." - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 + if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then + if ! sudo apt-get update --allow-releaseinfo-change; then + log_error "failure while updating package lists" + error_msg "Updating package lists failed!" + exit 1 + fi + else + status_msg "Package lists updated recently, skipping..." fi ### Install required packages diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh index ff953ce..18e063f 100644 --- a/scripts/octoeverywhere.sh +++ b/scripts/octoeverywhere.sh @@ -318,12 +318,16 @@ function install_octoeverywhere_dependencies() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info + ### Update system package info if lists > 3 days old status_msg "Updating package lists..." - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 + if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then + if ! sudo apt-get update --allow-releaseinfo-change; then + log_error "failure while updating package lists" + error_msg "Updating package lists failed!" + exit 1 + fi + else + status_msg "Package lists updated recently, skipping..." fi ### Install required packages diff --git a/scripts/utilities.sh b/scripts/utilities.sh index b3293ff..269bbdf 100644 --- a/scripts/utilities.sh +++ b/scripts/utilities.sh @@ -303,9 +303,22 @@ function dependency_check() { done echo - if sudo apt-get update --allow-releaseinfo-change && sudo apt-get install "${packages[@]}" -y; then + ### Update system package info if lists > 3 days old + status_msg "Updating package lists..." + if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then + if ! sudo apt-get update --allow-releaseinfo-change; then + log_error "failure while updating package lists" + error_msg "Updating package lists failed!" + exit 1 + fi + else + status_msg "Package lists updated recently, skipping..." + fi + + if sudo apt-get install "${packages[@]}" -y; then ok_msg "Dependencies installed!" else + log_error "failure while installing dependencies" error_msg "Installing dependencies failed!" return 1 # exit kiauh fi @@ -375,10 +388,20 @@ function check_system_updates() { function update_system() { status_msg "Updating System ..." - if sudo apt-get update --allow-releaseinfo-change && sudo apt-get upgrade -y; then + if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then + status_msg "Updating package lists..." + if ! sudo apt-get update --allow-releaseinfo-change; then + log_error "failure while updating package lists" + error_msg "Updating package lists failed!" + exit 1 + fi + else + status_msg "Package lists updated recently, skipping..." + fi + if sudo apt-get upgrade -y; then print_confirm "Update complete! Check the log above!\n ${yellow}KIAUH will not install any dist-upgrades or\n any packages which have been kept back!${green}" else - print_error "System update failed! Please watch for any errors printed above!" + print_error "System update failed! Please look for any errors printed above!" fi } -- 2.39.5 From 2d177e02192346378461c5c0af6e2791e6b4d80d Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Sun, 4 Jun 2023 17:34:56 -0400 Subject: [PATCH 07/17] chore: add VSCode artifacts to gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7084f49..560b8c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -klipper_repos.txt \ No newline at end of file +.vscode +*.code-workspace +klipper_repos.txt -- 2.39.5 From 4160c4aa77daf10e9353ff9fe053ea4eb6283667 Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Sun, 4 Jun 2023 23:01:48 -0400 Subject: [PATCH 08/17] refactor: dedupe apt update & install functions --- scripts/crowsnest.sh | 22 ++------ scripts/klipper.sh | 22 ++------ scripts/moonraker-telegram-bot.sh | 22 ++------ scripts/moonraker.sh | 22 ++------ scripts/octoeverywhere.sh | 22 ++------ scripts/ui/update_menu.sh | 2 +- scripts/utilities.sh | 86 +++++++++++++++++++------------ 7 files changed, 73 insertions(+), 125 deletions(-) diff --git a/scripts/crowsnest.sh b/scripts/crowsnest.sh index 393f6ab..20b29f5 100644 --- a/scripts/crowsnest.sh +++ b/scripts/crowsnest.sh @@ -197,7 +197,7 @@ function compare_crowsnest_versions() { } function install_crowsnest_dependencies() { - local packages + local packages log_name="Crowsnest" local install_script="${CROWSNEST_DIR}/tools/install.sh" ### read PKGLIST from official install-script @@ -208,25 +208,11 @@ function install_crowsnest_dependencies() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info if lists > 3 days old - status_msg "Updating package lists..." - if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 - fi - else - status_msg "Package lists updated recently, skipping..." - fi + ### Update system package lists if stale + update_system_package_lists ### Install required packages - status_msg "Installing required packages..." - if ! sudo apt-get install --yes "${packages[@]}"; then - log_error "failure while installing required crowsnest packages" - error_msg "Installing required packages failed!" - exit 1 - fi + install_system_packages "$log_name" "packages[@]" } function update_crowsnest() { diff --git a/scripts/klipper.sh b/scripts/klipper.sh index ca489fb..9fb7c00 100644 --- a/scripts/klipper.sh +++ b/scripts/klipper.sh @@ -295,7 +295,7 @@ function create_klipper_virtualenv() { # @param {string}: python_version - klipper-env python version # function install_klipper_packages() { - local packages python_version="${1}" + local packages log_name="Klipper" python_version="${1}" local install_script="${KLIPPER_DIR}/scripts/install-debian.sh" status_msg "Reading dependencies..." @@ -321,25 +321,11 @@ function install_klipper_packages() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info if lists > 3 days old - status_msg "Updating package lists..." - if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 - fi - else - status_msg "Package lists updated recently, skipping..." - fi + ### Update system package lists if stale + update_system_package_lists ### Install required packages - status_msg "Installing required packages..." - if ! sudo apt-get install --yes "${packages[@]}"; then - log_error "failure while installing required klipper packages" - error_msg "Installing required packages failed!" - exit 1 - fi + install_system_packages "$log_name" "packages[@]" } function create_klipper_service() { diff --git a/scripts/moonraker-telegram-bot.sh b/scripts/moonraker-telegram-bot.sh index ee0520f..0ccd931 100644 --- a/scripts/moonraker-telegram-bot.sh +++ b/scripts/moonraker-telegram-bot.sh @@ -110,7 +110,7 @@ function telegram_bot_setup_dialog() { } function install_telegram_bot_dependencies() { - local packages + local packages log_name="Telegram Bot" local install_script="${TELEGRAM_BOT_DIR}/scripts/install.sh" ### read PKGLIST from official install-script @@ -121,25 +121,11 @@ function install_telegram_bot_dependencies() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info if lists > 3 days old - status_msg "Updating package lists..." - if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 - fi - else - status_msg "Package lists updated recently, skipping..." - fi + ### Update system package lists if stale + update_system_package_lists ### Install required packages - status_msg "Installing required packages..." - if ! sudo apt-get install --yes "${packages[@]}"; then - log_error "failure while installing required moonraker-telegram-bot packages" - error_msg "Installing required packages failed!" - exit 1 - fi + install_system_packages "$log_name" "packages[@]" } function create_telegram_bot_virtualenv() { diff --git a/scripts/moonraker.sh b/scripts/moonraker.sh index a2020bf..9a89839 100644 --- a/scripts/moonraker.sh +++ b/scripts/moonraker.sh @@ -141,7 +141,7 @@ function moonraker_setup_dialog() { } function install_moonraker_dependencies() { - local packages + local packages log_name="Moonraker" local install_script="${MOONRAKER_DIR}/scripts/install-moonraker.sh" ### read PKGLIST from official install-script @@ -152,25 +152,11 @@ function install_moonraker_dependencies() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info if lists > 3 days old - status_msg "Updating package lists..." - if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 - fi - else - status_msg "Package lists updated recently, skipping..." - fi + ### Update system package lists if stale + update_system_package_lists ### Install required packages - status_msg "Installing required packages..." - if ! sudo apt-get install --yes "${packages[@]}"; then - log_error "failure while installing required moonraker packages" - error_msg "Installing required packages failed!" - exit 1 - fi + install_system_packages "$log_name" "packages[@]" } function create_moonraker_virtualenv() { diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh index 18e063f..a603b9d 100644 --- a/scripts/octoeverywhere.sh +++ b/scripts/octoeverywhere.sh @@ -307,7 +307,7 @@ function clone_octoeverywhere() { } function install_octoeverywhere_dependencies() { - local packages + local packages log_name="OctoEverywhere" local install_script="${OCTOEVERYWHERE_DIR}/install.sh" ### read PKGLIST from official install-script @@ -318,25 +318,11 @@ function install_octoeverywhere_dependencies() { echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}" - ### Update system package info if lists > 3 days old - status_msg "Updating package lists..." - if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 - fi - else - status_msg "Package lists updated recently, skipping..." - fi + ### Update system package lists if stale + update_system_package_lists ### Install required packages - status_msg "Installing required packages..." - if ! sudo apt-get install --yes "${packages[@]}"; then - log_error "failure while installing required octoeverywhere packages" - error_msg "Installing required packages failed!" - exit 1 - fi + install_system_packages "$log_name" "packages[@]" } #===================================================# diff --git a/scripts/ui/update_menu.sh b/scripts/ui/update_menu.sh index 61e61ee..549a937 100755 --- a/scripts/ui/update_menu.sh +++ b/scripts/ui/update_menu.sh @@ -69,7 +69,7 @@ function update_menu() { 10) do_action "update_crowsnest" "update_ui";; 11) - do_action "update_system" "update_ui";; + do_action "upgrade_system_packages" "update_ui";; a) do_action "update_all" "update_ui";; B|b) diff --git a/scripts/utilities.sh b/scripts/utilities.sh index 269bbdf..3383968 100644 --- a/scripts/utilities.sh +++ b/scripts/utilities.sh @@ -285,7 +285,7 @@ function python3_check() { function dependency_check() { local dep=( "${@}" ) - local packages + local packages log_name="dependencies" status_msg "Checking for the following dependencies:" #check if package is installed, if not write its name into array @@ -303,25 +303,12 @@ function dependency_check() { done echo - ### Update system package info if lists > 3 days old - status_msg "Updating package lists..." - if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 - fi - else - status_msg "Package lists updated recently, skipping..." - fi - - if sudo apt-get install "${packages[@]}" -y; then - ok_msg "Dependencies installed!" - else - log_error "failure while installing dependencies" - error_msg "Installing dependencies failed!" - return 1 # exit kiauh - fi + # update system package lists if stale + update_system_package_lists + + # install required packages + install_system_packages "$log_name" "packages[@]" + else ok_msg "Dependencies already met!" return @@ -371,8 +358,35 @@ function create_required_folders() { done } +function update_system_package_lists() { + local cache_mtime update_age + if [[ -e /var/lib/apt/periodic/update-success-stamp ]]; then + cache_mtime="$(stat -c $Y /var/lib/apt/periodic/update-success-stamp)" + elif [[ -e /var/lib/apt/lists ]]; then + cache_mtime="$(stat -c $Y /var/lib/apt/lists)" + else + log_error "failure determining package cache age, forcing update" + cache_mtime=0 + fi + + update_age="$(($(date +'%s') - cache_mtime))" + + # update if cache is greater than 48 hours old + if [[ $update_age -gt $((48*60*60)) ]]; then + status_msg "Updating package lists..." + if ! sudo apt-get update --allow-releaseinfo-change; then + log_error "failure while updating package lists" + error_msg "Updating package lists failed!" + exit 1 + fi + else + status_msg "Package lists updated recently, skipping..." + fi +} + function check_system_updates() { local updates_avail info_msg + update_system_package_lists updates_avail=$(apt list --upgradeable 2>/dev/null | sed "1d") if [[ -n ${updates_avail} ]]; then @@ -386,22 +400,26 @@ function check_system_updates() { echo "${info_msg}" } -function update_system() { - status_msg "Updating System ..." - if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -3)" ]]; then - status_msg "Updating package lists..." - if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" - error_msg "Updating package lists failed!" - exit 1 - fi - else - status_msg "Package lists updated recently, skipping..." - fi +function upgrade_system_packages() { + status_msg "Upgrading System ..." + update_system_package_lists if sudo apt-get upgrade -y; then - print_confirm "Update complete! Check the log above!\n ${yellow}KIAUH will not install any dist-upgrades or\n any packages which have been kept back!${green}" + print_confirm "Upgrade complete! Check the log above!\n ${yellow}KIAUH will not install any dist-upgrades or\n any packages which have been held back!${green}" else - print_error "System update failed! Please look for any errors printed above!" + print_error "System upgrade failed! Please look for any errors printed above!" + fi +} + +function install_system_packages() { + local log_name="$1" + local packages=("${!2}") + status_msg "Installing packages..." + if sudo apt-get install -y "${packages[@]}"; then + ok_msg "${log_name^} packages installed!" + else + log_error "failure while installing ${log_name,,} packages" + error_msg "Installing $log_name packages failed!" + exit 1 # exit kiauh fi } -- 2.39.5 From 5d674f326358719ea8710b348b63f575220544d8 Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Wed, 7 Jun 2023 23:11:36 -0400 Subject: [PATCH 09/17] refactor: clean up logging --- scripts/utilities.sh | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/scripts/utilities.sh b/scripts/utilities.sh index 3383968..15a1b0d 100644 --- a/scripts/utilities.sh +++ b/scripts/utilities.sh @@ -365,7 +365,7 @@ function update_system_package_lists() { elif [[ -e /var/lib/apt/lists ]]; then cache_mtime="$(stat -c $Y /var/lib/apt/lists)" else - log_error "failure determining package cache age, forcing update" + log_warning "Failure determining package cache age, forcing update" cache_mtime=0 fi @@ -375,29 +375,32 @@ function update_system_package_lists() { if [[ $update_age -gt $((48*60*60)) ]]; then status_msg "Updating package lists..." if ! sudo apt-get update --allow-releaseinfo-change; then - log_error "failure while updating package lists" + log_error "Failure while updating package lists!" error_msg "Updating package lists failed!" exit 1 fi else - status_msg "Package lists updated recently, skipping..." + log_info "Package lists updated recently, skipping update..." fi } function check_system_updates() { - local updates_avail info_msg - update_system_package_lists - updates_avail=$(apt list --upgradeable 2>/dev/null | sed "1d") - - if [[ -n ${updates_avail} ]]; then - info_msg="${yellow}System upgrade available!${white}" - # add system to application_updates_available in kiauh.ini - add_to_application_updates "system" + local updates_avail status + if ! update_system_package_lists; then + status="${red}Update check failed! ${white}" else - info_msg="${green}System up to date! ${white}" + updates_avail="$(apt list --upgradeable 2>/dev/null | sed "1d")" + + if [[ -n ${updates_avail} ]]; then + status="${yellow}System upgrade available!${white}" + # add system to application_updates_available in kiauh.ini + add_to_application_updates "system" + else + status="${green}System up to date! ${white}" + fi fi - - echo "${info_msg}" + + echo "${status}" } function upgrade_system_packages() { @@ -417,7 +420,7 @@ function install_system_packages() { if sudo apt-get install -y "${packages[@]}"; then ok_msg "${log_name^} packages installed!" else - log_error "failure while installing ${log_name,,} packages" + log_error "Failure while installing ${log_name,,} packages" error_msg "Installing $log_name packages failed!" exit 1 # exit kiauh fi -- 2.39.5 From f22b9da734cd7a621f7fe557c78a94bade5ca2e5 Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Wed, 7 Jun 2023 23:46:55 -0400 Subject: [PATCH 10/17] fix: stat syntax error; apt output in update menu --- scripts/utilities.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/utilities.sh b/scripts/utilities.sh index 15a1b0d..868b667 100644 --- a/scripts/utilities.sh +++ b/scripts/utilities.sh @@ -359,11 +359,12 @@ function create_required_folders() { } function update_system_package_lists() { - local cache_mtime update_age + local cache_mtime update_age silent + if [[ $1 == '--silent' ]]; then silent=1; shift; fi if [[ -e /var/lib/apt/periodic/update-success-stamp ]]; then - cache_mtime="$(stat -c $Y /var/lib/apt/periodic/update-success-stamp)" + cache_mtime="$(stat -c %Y /var/lib/apt/periodic/update-success-stamp)" elif [[ -e /var/lib/apt/lists ]]; then - cache_mtime="$(stat -c $Y /var/lib/apt/lists)" + cache_mtime="$(stat -c %Y /var/lib/apt/lists)" else log_warning "Failure determining package cache age, forcing update" cache_mtime=0 @@ -373,10 +374,10 @@ function update_system_package_lists() { # update if cache is greater than 48 hours old if [[ $update_age -gt $((48*60*60)) ]]; then - status_msg "Updating package lists..." + if [[ ! $silent ]]; then status_msg "Updating package lists..."; fi if ! sudo apt-get update --allow-releaseinfo-change; then log_error "Failure while updating package lists!" - error_msg "Updating package lists failed!" + if [[ ! $silent ]]; then error_msg "Updating package lists failed!"; fi exit 1 fi else @@ -386,7 +387,7 @@ function update_system_package_lists() { function check_system_updates() { local updates_avail status - if ! update_system_package_lists; then + if ! update_system_package_lists --silent; then status="${red}Update check failed! ${white}" else updates_avail="$(apt list --upgradeable 2>/dev/null | sed "1d")" -- 2.39.5 From 7788e7cd877a25c380b9e7b5329816ee1863d0b2 Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Thu, 8 Jun 2023 00:40:23 -0400 Subject: [PATCH 11/17] fix: now the --silent flag is always silent --- scripts/utilities.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/utilities.sh b/scripts/utilities.sh index 868b667..4affc3c 100644 --- a/scripts/utilities.sh +++ b/scripts/utilities.sh @@ -375,10 +375,13 @@ function update_system_package_lists() { # update if cache is greater than 48 hours old if [[ $update_age -gt $((48*60*60)) ]]; then if [[ ! $silent ]]; then status_msg "Updating package lists..."; fi - if ! sudo apt-get update --allow-releaseinfo-change; then + if ! sudo apt-get update --allow-releaseinfo-change &>/dev/null; then log_error "Failure while updating package lists!" if [[ ! $silent ]]; then error_msg "Updating package lists failed!"; fi exit 1 + else + log_info "Package lists updated successfully" + if [[ ! $silent ]]; then status_msg "Updated package lists."; fi fi else log_info "Package lists updated recently, skipping update..." -- 2.39.5 From 9b64199a2fa79e193b43f6a8d2bb51ad8ef72722 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sat, 10 Jun 2023 09:55:47 +0200 Subject: [PATCH 12/17] refactor: refactor update_system_package_lists Signed-off-by: Dominik Willner --- scripts/crowsnest.sh | 2 +- scripts/klipper.sh | 4 ++-- scripts/moonraker-telegram-bot.sh | 2 +- scripts/moonraker.sh | 2 +- scripts/octoeverywhere.sh | 2 +- scripts/utilities.sh | 21 ++++++++++++--------- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/scripts/crowsnest.sh b/scripts/crowsnest.sh index 20b29f5..fb864ab 100644 --- a/scripts/crowsnest.sh +++ b/scripts/crowsnest.sh @@ -212,7 +212,7 @@ function install_crowsnest_dependencies() { update_system_package_lists ### Install required packages - install_system_packages "$log_name" "packages[@]" + install_system_packages "${log_name}" "packages[@]" } function update_crowsnest() { diff --git a/scripts/klipper.sh b/scripts/klipper.sh index 9fb7c00..6ea8c28 100644 --- a/scripts/klipper.sh +++ b/scripts/klipper.sh @@ -325,7 +325,7 @@ function install_klipper_packages() { update_system_package_lists ### Install required packages - install_system_packages "$log_name" "packages[@]" + install_system_packages "${log_name}" "packages[@]" } function create_klipper_service() { @@ -624,4 +624,4 @@ function get_klipper_python_ver() { local version version=$("${KLIPPY_ENV}"/bin/python --version 2>&1 | cut -d" " -f2 | cut -d"." -f1) echo "${version}" -} \ No newline at end of file +} diff --git a/scripts/moonraker-telegram-bot.sh b/scripts/moonraker-telegram-bot.sh index 0ccd931..e88a93f 100644 --- a/scripts/moonraker-telegram-bot.sh +++ b/scripts/moonraker-telegram-bot.sh @@ -125,7 +125,7 @@ function install_telegram_bot_dependencies() { update_system_package_lists ### Install required packages - install_system_packages "$log_name" "packages[@]" + install_system_packages "${log_name}" "packages[@]" } function create_telegram_bot_virtualenv() { diff --git a/scripts/moonraker.sh b/scripts/moonraker.sh index 9a89839..e971878 100644 --- a/scripts/moonraker.sh +++ b/scripts/moonraker.sh @@ -156,7 +156,7 @@ function install_moonraker_dependencies() { update_system_package_lists ### Install required packages - install_system_packages "$log_name" "packages[@]" + install_system_packages "${log_name}" "packages[@]" } function create_moonraker_virtualenv() { diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh index a603b9d..635c443 100644 --- a/scripts/octoeverywhere.sh +++ b/scripts/octoeverywhere.sh @@ -322,7 +322,7 @@ function install_octoeverywhere_dependencies() { update_system_package_lists ### Install required packages - install_system_packages "$log_name" "packages[@]" + install_system_packages "${log_name}" "packages[@]" } #===================================================# diff --git a/scripts/utilities.sh b/scripts/utilities.sh index 4affc3c..7081876 100644 --- a/scripts/utilities.sh +++ b/scripts/utilities.sh @@ -307,7 +307,7 @@ function dependency_check() { update_system_package_lists # install required packages - install_system_packages "$log_name" "packages[@]" + install_system_packages "${log_name}" "packages[@]" else ok_msg "Dependencies already met!" @@ -359,8 +359,10 @@ function create_required_folders() { } function update_system_package_lists() { - local cache_mtime update_age silent - if [[ $1 == '--silent' ]]; then silent=1; shift; fi + local cache_mtime update_age update_interval silent + + if [[ $1 == '--silent' ]]; then silent="true"; fi + if [[ -e /var/lib/apt/periodic/update-success-stamp ]]; then cache_mtime="$(stat -c %Y /var/lib/apt/periodic/update-success-stamp)" elif [[ -e /var/lib/apt/lists ]]; then @@ -371,17 +373,18 @@ function update_system_package_lists() { fi update_age="$(($(date +'%s') - cache_mtime))" + update_interval=$((48*60*60)) # 48hrs - # update if cache is greater than 48 hours old - if [[ $update_age -gt $((48*60*60)) ]]; then - if [[ ! $silent ]]; then status_msg "Updating package lists..."; fi + # update if cache is greater than update_interval + if (( update_age > update_interval )); then + if [[ ! ${silent} == "true" ]]; then status_msg "Updating package lists..."; fi if ! sudo apt-get update --allow-releaseinfo-change &>/dev/null; then log_error "Failure while updating package lists!" - if [[ ! $silent ]]; then error_msg "Updating package lists failed!"; fi + if [[ ! ${silent} == "true" ]]; then error_msg "Updating package lists failed!"; fi exit 1 else log_info "Package lists updated successfully" - if [[ ! $silent ]]; then status_msg "Updated package lists."; fi + if [[ ! ${silent} == "true" ]]; then status_msg "Updated package lists."; fi fi else log_info "Package lists updated recently, skipping update..." @@ -425,7 +428,7 @@ function install_system_packages() { ok_msg "${log_name^} packages installed!" else log_error "Failure while installing ${log_name,,} packages" - error_msg "Installing $log_name packages failed!" + error_msg "Installing ${log_name} packages failed!" exit 1 # exit kiauh fi } -- 2.39.5 From 5d7debd65ed9cbe2dc1d56ecdba974bf6b29662e Mon Sep 17 00:00:00 2001 From: Kyriel Abad Date: Sun, 11 Jun 2023 05:00:23 +0800 Subject: [PATCH 13/17] readme: fix typos in README.md (#352) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e75d00c..2cabb75 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ that you have a functional Linux system on hand. `Raspberry Pi OS Lite (32bit)` if you are using a Raspberry Pi. The [official Raspberry Pi Imager](https://www.raspberrypi.com/software/) is the simplest way to flash an image like this to an SD card. -* Once you downloaded, installed and launched the Raspberry Pi Imager +* Once you have downloaded, installed and launched the Raspberry Pi Imager, select `Choose OS -> Raspberry Pi OS (other)`: \

KIAUH logo @@ -47,7 +47,7 @@ select `Choose OS -> Raspberry Pi OS (other)`: \ * Back in the Raspberry Pi Imager's main menu, select the corresponding SD card to which you want to flash the image. -* Make sure to go into the Advaced Option (the cog icon in the lower left corner of the main menu) +* Make sure to go into the Advanced Option (the cog icon in the lower left corner of the main menu) and enable SSH and configure Wi-Fi. * If you need more help for using the Raspberry Pi Imager, please visit the [official documentation](https://www.raspberrypi.com/documentation/computers/getting-started.html). @@ -68,14 +68,14 @@ sudo apt-get update && sudo apt-get install git -y ``` * **Step 2:** \ -Once git is installed, use the following command to download KIAUH into your home-directoy: +Once git is installed, use the following command to download KIAUH into your home-directory: ```shell cd ~ && git clone https://github.com/th33xitus/kiauh.git ``` * **Step 3:** \ -Finally start KIAUH by running the next command: +Finally, start KIAUH by running the next command: ```shell ./kiauh/kiauh.sh -- 2.39.5 From 7082aea22bda8dfaf1e39f69045fb5822bbfbe8a Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Sun, 11 Jun 2023 21:44:52 -0400 Subject: [PATCH 14/17] fix: cache or recache password for sudo before drawing update menu UI --- scripts/ui/update_menu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/ui/update_menu.sh b/scripts/ui/update_menu.sh index 549a937..169d9b3 100755 --- a/scripts/ui/update_menu.sh +++ b/scripts/ui/update_menu.sh @@ -11,7 +11,7 @@ set -e -function update_ui() { +function update_ui() { top_border echo -e "| ${green}~~~~~~~~~~~~~~ [ Update Menu ] ~~~~~~~~~~~~~~${white} |" hr @@ -40,6 +40,7 @@ function update_ui() { } function update_menu() { + clear -x && sudo -v && clear -x # (re)cache sudo credentials so password prompt doesn't bork ui do_action "" "update_ui" local action -- 2.39.5 From bbc341b35dc9022b6acb8dceed05b339a17a4ee0 Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Sun, 11 Jun 2023 22:06:24 -0400 Subject: [PATCH 15/17] fix: update_system_package_lists return 1 on fail rather than exiting --- scripts/utilities.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utilities.sh b/scripts/utilities.sh index 7081876..f0ff659 100644 --- a/scripts/utilities.sh +++ b/scripts/utilities.sh @@ -381,7 +381,7 @@ function update_system_package_lists() { if ! sudo apt-get update --allow-releaseinfo-change &>/dev/null; then log_error "Failure while updating package lists!" if [[ ! ${silent} == "true" ]]; then error_msg "Updating package lists failed!"; fi - exit 1 + return 1 else log_info "Package lists updated successfully" if [[ ! ${silent} == "true" ]]; then status_msg "Updated package lists."; fi -- 2.39.5 From 4a403b9132f7d0093de16bcb499b85a1fadb65f3 Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Sun, 11 Jun 2023 23:30:38 -0400 Subject: [PATCH 16/17] fix: also (re)cache sudo creds before drawing install menu for consistency --- scripts/ui/install_menu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/ui/install_menu.sh b/scripts/ui/install_menu.sh index 2ebcc00..842c367 100755 --- a/scripts/ui/install_menu.sh +++ b/scripts/ui/install_menu.sh @@ -34,7 +34,8 @@ function install_ui() { } function install_menu() { - clear && print_header + clear -x && sudo -v && clear -x # (re)cache sudo credentials so password prompt doesn't bork ui + print_header install_ui ### save all installed webinterface ports to the ini file -- 2.39.5 From c9699246bb82ee9f21366f6768aafe5088ffac82 Mon Sep 17 00:00:00 2001 From: Cameron Ryder Date: Sun, 11 Jun 2023 23:41:23 -0400 Subject: [PATCH 17/17] fix: clarify check_euid message regarding credential prompts --- scripts/utilities.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/utilities.sh b/scripts/utilities.sh index f0ff659..91ab5ce 100644 --- a/scripts/utilities.sh +++ b/scripts/utilities.sh @@ -20,6 +20,8 @@ function check_euid() { echo -e "${red}" top_border echo -e "| !!! THIS SCRIPT MUST NOT RUN AS ROOT !!! |" + echo -e "| |" + echo -e "| It will ask for credentials as needed. |" bottom_border echo -e "${white}" exit 1 -- 2.39.5