From 4bb2e32e727f749fde842d22d19051106a529133 Mon Sep 17 00:00:00 2001 From: Quinn Damerell Date: Fri, 24 Feb 2023 13:36:05 -0800 Subject: [PATCH 1/9] readme update --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4e24255..f1a5e6f 100644 --- a/README.md +++ b/README.md @@ -78,22 +78,43 @@ git clone https://github.com/th33xitus/kiauh.git by jordanruthe by OctoPrint + +

Moonraker-Telegram-Bot

PrettyGCode for Klipper

Obico for Klipper

- + nlef avatar Kragrathea avatar Obico logo - + by nlef by Kragrathea by Obico + + +

+

OctoEverywhere For Klipper

+

+ + + + +OctoEverywhere Logo + + + + + +by Quinn Damerell + + + ## **Credits** -- 2.39.5 From fd4a95ec3fc1b22be0e82f7a74b735a8d95f7744 Mon Sep 17 00:00:00 2001 From: Quinn Damerell Date: Fri, 24 Feb 2023 13:38:52 -0800 Subject: [PATCH 2/9] more updates --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f1a5e6f..714cf04 100644 --- a/README.md +++ b/README.md @@ -99,13 +99,13 @@ git clone https://github.com/th33xitus/kiauh.git

-

OctoEverywhere For Klipper

+

OctoEverywhere For Klipper

-OctoEverywhere Logo +OctoEverywhere Logo -- 2.39.5 From eb7110aeea9424682d8a4882af0dbcf743940f89 Mon Sep 17 00:00:00 2001 From: Quinn Damerell Date: Fri, 24 Feb 2023 15:13:55 -0800 Subject: [PATCH 3/9] work --- scripts/globals.sh | 4 + scripts/octoeverywhere.sh | 339 +++++++++++++++++++++++++++++++++++++ scripts/ui/install_menu.sh | 15 +- scripts/ui/main_menu.sh | 1 + scripts/ui/remove_menu.sh | 5 +- scripts/ui/update_menu.sh | 9 +- 6 files changed, 363 insertions(+), 10 deletions(-) create mode 100644 scripts/octoeverywhere.sh diff --git a/scripts/globals.sh b/scripts/globals.sh index 81629d6..c891ab4 100644 --- a/scripts/globals.sh +++ b/scripts/globals.sh @@ -69,6 +69,10 @@ function set_globals() { MOONRAKER_OBICO_DIR="${HOME}/moonraker-obico" MOONRAKER_OBICO_REPO="https://github.com/TheSpaghettiDetective/moonraker-obico.git" + #=============== MOONRAKER-OBICO ================# + OCTOEVERYWHERE_DIR="${HOME}/octoeverywhere" + OCTOEVERYWHERE_REPO="https://github.com/QuinnDamerell/OctoPrint-OctoEverywhere.git" + #=============== Crowsnest ================# CROWSNEST_DIR="${HOME}/crowsnest" CROWSNEST_REPO="https://github.com/mainsail-crew/crowsnest.git" diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh new file mode 100644 index 0000000..d052921 --- /dev/null +++ b/scripts/octoeverywhere.sh @@ -0,0 +1,339 @@ +#!/usr/bin/env bash + +#=======================================================================# +# Copyright (C) 2020 - 2022 Dominik Willner # +# # +# This file is part of KIAUH - Klipper Installation And Update Helper # +# https://github.com/th33xitus/kiauh # +# # +# This file may be distributed under the terms of the GNU GPLv3 license # +#=======================================================================# + +# +# This file is written and maintined by Quinn Damerell from OctoEverywhere +# Please contact our support team if you need any help! +# https://octoeverywhre.com/support +# + +set -e + +#===================================================# +#============== INSTALL OCTOEVERYWHERE ============# +#===================================================# + +function octoeverywhere_systemd() { + local services + services=$(find "${SYSTEMD}" -maxdepth 1 -regextype posix-extended -regex "${SYSTEMD}/octoeverywhere(-[0-9a-zA-Z]+)?.service") + echo "${services}" +} + +function octoeverywhere_setup_dialog() { + echo -e "\n${magenta}OctoEverywhere Free & Unlimited Remote Access To Mainsail Or Fluidd... Everywhere!\nNow including free and unlimited AI print failure detection!\n${white}" + + # First, check for moonraker service instances. + local moonraker_count + local moonraker_names + moonraker_count=$(moonraker_systemd | wc -w) + if (( moonraker_count == 0 )); then + ### return early if moonraker is not installed + local error="Moonraker not installed! Please install Moonraker first!" + log_error "OctoEverywhere setup started without Moonraker being installed. Aborting setup." + print_error "${error}" && return + elif (( moonraker_count > 1 )); then + # moonraker_names is valid only in case of multi-instance + read -r -a moonraker_names <<< "$(get_multi_instance_names)" + fi + + # Next, check for any existing OctoEverywhere servcies. + local octoeverywhere_services + local existing_octoeverywhere_count + octoeverywhere_services=$(octoeverywhere_systemd) + existing_octoeverywhere_count=$(echo "${octoeverywhere_services}" | wc -w ) + + # We need to make the moonraker instance count to the OctoEverywhere service count. + local allowed_octoeverywhere_count=$(( moonraker_count - existing_octoeverywhere_count )) + if (( allowed_octoeverywhere_count > 0 )); then + local new_octoeverywhere_count + + ### Step 1: Ask for the number of moonraker-obico instances to install + if (( moonraker_count == 1 )); then + ok_msg "Moonraker installation found!\n" + new_octoeverywhere_count=1 + elif (( moonraker_count > 1 )); then + top_border + printf "|${green}%-55s${white}|\n" " ${moonraker_count} Moonraker instances found!" + for name in "${moonraker_names[@]}"; do + printf "|${cyan}%-57s${white}|\n" " ● moonraker-${name}" + done + blank_line + if (( existing_octoeverywhere_count > 0 )); then + printf "|${green}%-55s${white}|\n" " ${existing_octoeverywhere_count} OctoEverywhere instances already installed!" + for svc in ${octoeverywhere_services}; do + printf "|${cyan}%-57s${white}|\n" " ● octoeverywhere-$(get_instance_name "${svc}")" + done + fi + blank_line + echo -e "| The setup will apply the same names to |" + echo -e "| OctoEverywhere |" + blank_line + echo -e "| Please select the number of OctoEverywhere instances |" + echo -e "| to install. Usually one OctoEverywhere instance per |" + echo -e "| Moonraker instance is required, but you may not |" + echo -e "| install more OctoEverywhere instances than available |" + echo -e "| Moonraker instances. |" + bottom_border + + ### ask for amount of instances + local re="^[1-9][0-9]*$" + while [[ ! ${new_octoeverywhere_count} =~ ${re} || ${new_octoeverywhere_count} -gt ${allowed_octoeverywhere_count} ]]; do + read -p "${cyan}###### Number of new OctoEverywhere instances to set up:${white} " -i "${allowed_octoeverywhere_count}" -e new_octoeverywhere_count + ### break if input is valid + [[ ${new_octoeverywhere_count} =~ ${re} && ${new_octoeverywhere_count} -le ${allowed_octoeverywhere_count} ]] && break + ### conditional error messages + [[ ! ${new_octoeverywhere_count} =~ ${re} ]] && error_msg "Input not a number" + (( new_octoeverywhere_count > allowed_octoeverywhere_count )) && error_msg "Number of OctoEverywhere instances larger than installed Moonraker instances" + done && select_msg "${new_octoeverywhere_count}" + else + log_error "Internal error. moonraker_count of '${moonraker_count}' not equal or grather than one!" + return 1 + fi # (( moonraker_count == 1 )) + fi # (( allowed_octoeverywhere_count > 0 )) + + # Special case for one moonraker instance with OctoEverywhere already installed. + # If the user selects the install option again, they might be trying to recover the install + # or complete a printer link they didn't finish in the past. + # So in this case, we will allow them to run the install script again, since it's safe to run + # if the service is already installed, it will rpaire any missing issues. + if (( allowed_octoeverywhere_count == 0 && moonraker_count == 1 )); then + local yn + while true; do + echo "${yellow}OctoEverywhere is already installed.${white}" + echo "It is safe to run the install again to repair any issues or if the printer isn't linked, run the printer linking logic again." + echo "" + local question="Do you want to run the OctoEverywhere recovery or linking logic again?" + read -p "${cyan}###### ${question} (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 OctoEverywhere setup ...\n" + return;; + *) + error_msg "Invalid Input!";; + esac + done + # The user responded yes, allow the install to run again. + allowed_octoeverywhere_count=1 + fi + + # If there's something to intall, do it! + if (( allowed_octoeverywhere_count > 0 )); then + + (( new_octoeverywhere_count > 1 )) && status_msg "Installing ${new_octoeverywhere_count} OctoEverywhere instances ..." + (( new_octoeverywhere_count == 1 )) && status_msg "Installing OctoEverywhere ..." + + # Ensure the basic system depdencies are installed. + local dep=(git dfu-util virtualenv python3 python3-pip python3-venv) + dependency_check "${dep[@]}" + + # Close the repo + clone_octoeverywhere "${OCTOEVERYWHERE_REPO}" + + # Call install with the correct args. + local instance_cfg_dirs + read -r -a instance_cfg_dirs <<< "$(get_instance_folder_path "config")" + echo instance_cfg_dirs[0] + + if (( moonraker_count == 1 )); then + "${OCTOEVERYWHERE_DIR}/install.sh" "${instance_cfg_dirs[0]}/moonraker.conf" + elif (( moonraker_count > 1 )); then + local j=${existing_octoeverywhere_count} + + for (( i=1; i <= new_octoeverywhere_count; i++ )); do + "${OCTOEVERYWHERE_DIR}/install.sh" "${instance_cfg_dirs[${j}]}/moonraker.conf" + j=$(( j + 1 )) + done && unset j + fi # (( moonraker_count == 1 )) + fi # (( allowed_octoeverywhere_count > 0 )) +} + +function clone_octoeverywhere() { + local repo=${1} + + status_msg "Cloning OctoEverywhere..." + ### force remove existing repos + [[ -d "${OCTOEVERYWHERE_DIR}" ]] && rm -rf "${OCTOEVERYWHERE_DIR}" + + cd "${HOME}" || exit 1 + if ! git clone "${repo}" "${OCTOEVERYWHERE_DIR}"; then + print_error "Cloning OctoEverywhere from\n ${repo}\n failed!" + exit 1 + fi +} + +function octoeverywhere_install() { + "${OCTOEVERYWHERE_DIR}/install.sh" "$@" +} + +#===================================================# +#============= REMOVE MOONRAKER-OBICO ==============# +#===================================================# + +function remove_octoeverywhere_systemd() { + [[ -z $(octoeverywhere_systemd) ]] && return + status_msg "Removing OctoEverywhere Systemd Services ..." + + for service in $(octoeverywhere_systemd | cut -d"/" -f5); do + status_msg "Removing ${service} ..." + sudo systemctl stop "${service}" + sudo systemctl disable "${service}" + sudo rm -f "${SYSTEMD}/${service}" + ok_msg "Done!" + done + + ### reloading units + sudo systemctl daemon-reload + sudo systemctl reset-failed + ok_msg "OctoEverywhere Services removed!" +} + +function remove_octoeverywhere_logs() { + local files regex="\/home\/${USER}\/([A-Za-z0-9_]+)\/logs\/octoeverywhere(-[0-9a-zA-Z]+)?\.log(.*)?" + files=$(find "${HOME}" -maxdepth 3 -regextype posix-extended -regex "${regex}" | sort) + + if [[ -n ${files} ]]; then + for file in ${files}; do + status_msg "Removing ${file} ..." + rm -f "${file}" + ok_msg "${file} removed!" + done + fi +} + +function remove_octoeverywhere_dir() { + [[ ! -d ${OCTOEVERYWHERE_DIR} ]] && return + + status_msg "Removing OctoEverywhere directory ..." + rm -rf "${OCTOEVERYWHERE_DIR}" + ok_msg "Directory removed!" +} + +function remove_octoeverywhere_logs() { + local files regex="\/home\/${USER}\/([A-Za-z0-9_]+)\/logs\/octoeverywhere(-[0-9a-zA-Z]+)?\.log(.*)?" + files=$(find "${HOME}" -maxdepth 3 -regextype posix-extended -regex "${regex}" | sort) + + if [[ -n ${files} ]]; then + for file in ${files}; do + status_msg "Removing ${file} ..." + rm -f "${file}" + ok_msg "${file} removed!" + done + fi +} + +function remove_octoeverywhere_config() { + # Remove the system config but not the main config, so the printer id doesn't get lost. + local files regex="\/home\/${USER}\/([A-Za-z0-9_]+)\/logs\/octoeverywhere-system(-[0-9a-zA-Z]+)?\.cfg(.*)?" + files=$(find "${HOME}" -maxdepth 4 -regextype posix-extended -regex "${regex}" | sort) + + if [[ -n ${files} ]]; then + for file in ${files}; do + status_msg "Removing ${file} ..." + rm -f "${file}" + ok_msg "${file} removed!" + done + fi +} + +function remove_octoeverywhere_env() { + [[ ! -d "${HOME}octoeverywhere-env" ]] && return + + status_msg "Removing octoeverywhere-env directory ..." + rm -rf "${HOME}/octoeverywhere-env" + ok_msg "Directory removed!" +} + +function remove_octoeverywhere() +{ + remove_octoeverywhere_systemd + remove_octoeverywhere_logs + remove_octoeverywhere_dir + remove_octoeverywhere_env + remove_octoeverywhere_config + + print_confirm "OctoEverywhere was successfully removed!" + return +} + +#===================================================# +#============= UPDATE MOONRAKER-OBICO ==============# +#===================================================# + +function update_octoeverywhere() { + # Since our update might require new python packages or system packages, ask the user to use the + # moonraker update manager to do it, since that takes care of it. + print_error "Please use the Moonraker Update Manager from the Mainsail or Fluidd UI to update OctoEverywhere.\n Contact our support team if you need help! support@octoeverywhere.com" +} + +#===================================================# +#============= MOONRAKER-OBICO STATUS ==============# +#===================================================# + +function get_octoeverywhere_status() { + local status + local service_count + local is_linked + local octoeverywhere_services + + octoeverywhere_services=$(octoeverywhere_systemd) + service_count=$(echo "${octoeverywhere_services}" | wc -w ) + + if (( service_count == 0 )); then + status="Not installed!" + elif [[ ! -d "${OCTOEVERYWHERE_DIR}" ]]; then + status="Incomplete!" + else + status="Installed!" + fi + + echo "${status}" +} + +function get_local_octoeverywhere_commit() { + [[ ! -d ${OCTOEVERYWHERE_DIR} || ! -d "${OCTOEVERYWHERE_DIR}/.git" ]] && return + + local commit + cd "${OCTOEVERYWHERE_DIR}" + commit="$(git describe HEAD --always --tags | cut -d "-" -f 1,2)" + echo "${commit}" +} + +function get_remote_octoeverywhere_commit() { + [[ ! -d ${OCTOEVERYWHERE_DIR} || ! -d "${OCTOEVERYWHERE_DIR}/.git" ]] && return + + local commit + cd "${OCTOEVERYWHERE_DIR}" && git fetch origin -q + commit=$(git describe origin/master --always --tags | cut -d "-" -f 1,2) + echo "${commit}" +} + +function compare_octoeverywhere_versions() { + local versions local_ver remote_ver + local_ver="$(get_local_octoeverywhere_commit)" + remote_ver="$(get_remote_octoeverywhere_commit)" + + if [[ ${local_ver} != "${remote_ver}" ]]; then + versions="${yellow}$(printf " %-14s" "${local_ver}")${white}" + versions+="|${green}$(printf " %-13s" "${remote_ver}")${white}" + # Don't do this, since we don't want Kiauh to update us, since we might need package updates. + # add moonraker to application_updates_available in kiauh.ini + # add_to_application_updates "octoeverywhere" + else + versions="${green}$(printf " %-14s" "${local_ver}")${white}" + versions+="|${green}$(printf " %-13s" "${remote_ver}")${white}" + fi + + echo "${versions}" +} diff --git a/scripts/ui/install_menu.sh b/scripts/ui/install_menu.sh index c17942f..9db0030 100755 --- a/scripts/ui/install_menu.sh +++ b/scripts/ui/install_menu.sh @@ -20,15 +20,16 @@ function install_ui() { echo -e "| functions on a completely fresh system. |" hr echo -e "| Firmware & API: | 3rd Party Webinterface: |" - echo -e "| 1) [Klipper] | 6) [OctoPrint] |" + echo -e "| 1) [Klipper] | 6) [OctoPrint] |" echo -e "| 2) [Moonraker] | |" echo -e "| | Other: |" - echo -e "| Klipper Webinterface: | 7) [PrettyGCode] |" - echo -e "| 3) [Mainsail] | 8) [Telegram Bot] |" - echo -e "| 4) [Fluidd] | 9) $(obico_install_title) |" + echo -e "| Klipper Webinterface: | 7) [PrettyGCode] |" + echo -e "| 3) [Mainsail] | 8) [Telegram Bot] |" + echo -e "| 4) [Fluidd] | 9) $(obico_install_title)|" + echo -e "| | 10) [OctoEverywhere For Klipper] |" echo -e "| | |" echo -e "| Touchscreen GUI: | Webcam Streamer: |" - echo -e "| 5) [KlipperScreen] | 10) [Crowsnest] |" + echo -e "| 5) [KlipperScreen] | 11) [Crowsnest] |" back_footer } @@ -64,7 +65,9 @@ function install_menu() { do_action "telegram_bot_setup_dialog" "install_ui";; 9) do_action "moonraker_obico_setup_dialog" "install_ui";; - 10) + 10) + do_action "octoeverywhere_setup_dialog" "install_ui";; + 11) do_action "install_crowsnest" "install_ui";; B|b) clear; main_menu; break;; diff --git a/scripts/ui/main_menu.sh b/scripts/ui/main_menu.sh index 42e9a06..56d868e 100755 --- a/scripts/ui/main_menu.sh +++ b/scripts/ui/main_menu.sh @@ -31,6 +31,7 @@ function main_ui() { echo -e "| 6) [Settings] | Telegram Bot: $(print_status "telegram_bot")|" echo -e "| | Crowsnest: $(print_status "crowsnest")|" echo -e "| | Obico: $(print_status "moonraker_obico")|" + echo -e "| |OctoEverywhere: $(print_status "octoeverywhere")|" echo -e "| | |" echo -e "| $(print_kiauh_version)| Octoprint: $(print_status "octoprint")|" quit_footer diff --git a/scripts/ui/remove_menu.sh b/scripts/ui/remove_menu.sh index 0e6dca2..e79a758 100755 --- a/scripts/ui/remove_menu.sh +++ b/scripts/ui/remove_menu.sh @@ -28,7 +28,8 @@ function remove_ui() { echo -e "| Touchscreen GUI: | 9) [PrettyGCode] |" echo -e "| 5) [KlipperScreen] | 10) [Telegram Bot] |" echo -e "| | 11) [Obico for Klipper] |" - echo -e "| | 12) [NGINX] |" + echo -e "| | 12) [OctoEverywhere] |" + echo -e "| | 13) [NGINX] |" back_footer } @@ -62,6 +63,8 @@ function remove_menu() { 11) do_action "remove_moonraker_obico" "remove_ui";; 12) + do_action "remove_octoeverywhere" "remove_ui";; + 13) do_action "remove_nginx" "remove_ui";; B|b) clear; main_menu; break;; diff --git a/scripts/ui/update_menu.sh b/scripts/ui/update_menu.sh index 8e7f7a9..15ec0e9 100755 --- a/scripts/ui/update_menu.sh +++ b/scripts/ui/update_menu.sh @@ -32,9 +32,10 @@ function update_ui() { echo -e "| 6) [PrettyGCode] |$(compare_prettygcode_versions)|" echo -e "| 7) [Telegram Bot] |$(compare_telegram_bot_versions)|" echo -e "| 8) [Obico for Klipper]|$(compare_moonraker_obico_versions)|" - echo -e "| 9) [Crowsnest] |$(compare_crowsnest_versions)|" + echo -e "| 9) [OctoEverywhere] |$(compare_octoeverywhere_versions)|" + echo -e "| 10)[Crowsnest] |$(compare_crowsnest_versions)|" echo -e "| |------------------------------|" - echo -e "| 10)[System] | $(check_system_updates) |" + echo -e "| 11)[System] | $(check_system_updates) |" back_footer } @@ -64,8 +65,10 @@ function update_menu() { 8) do_action "update_moonraker_obico" "update_ui";; 9) - do_action "update_crowsnest" "update_ui";; + do_action "update_octoeverywhere" "update_ui";; 10) + do_action "update_crowsnest" "update_ui";; + 11) do_action "update_system" "update_ui";; a) do_action "update_all" "update_ui";; -- 2.39.5 From 5e1803a484c0fc5c2ac8b9ed80b2c57aa4df43a1 Mon Sep 17 00:00:00 2001 From: Quinn Damerell Date: Fri, 24 Feb 2023 15:20:58 -0800 Subject: [PATCH 4/9] Small updates! --- README.md | 2 +- scripts/globals.sh | 2 +- scripts/octoeverywhere.sh | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 714cf04..f7a0efd 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ -
+

diff --git a/scripts/globals.sh b/scripts/globals.sh index c891ab4..6ca19fc 100644 --- a/scripts/globals.sh +++ b/scripts/globals.sh @@ -69,7 +69,7 @@ function set_globals() { MOONRAKER_OBICO_DIR="${HOME}/moonraker-obico" MOONRAKER_OBICO_REPO="https://github.com/TheSpaghettiDetective/moonraker-obico.git" - #=============== MOONRAKER-OBICO ================# + #=============== OCTOEVERYWHERE ================# OCTOEVERYWHERE_DIR="${HOME}/octoeverywhere" OCTOEVERYWHERE_REPO="https://github.com/QuinnDamerell/OctoPrint-OctoEverywhere.git" diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh index d052921..53c9692 100644 --- a/scripts/octoeverywhere.sh +++ b/scripts/octoeverywhere.sh @@ -10,7 +10,7 @@ #=======================================================================# # -# This file is written and maintined by Quinn Damerell from OctoEverywhere +# This file is written and maintained by Quinn Damerell from OctoEverywhere # Please contact our support team if you need any help! # https://octoeverywhre.com/support # @@ -18,7 +18,7 @@ set -e #===================================================# -#============== INSTALL OCTOEVERYWHERE ============# +#============== Install ============# #===================================================# function octoeverywhere_systemd() { @@ -44,7 +44,7 @@ function octoeverywhere_setup_dialog() { read -r -a moonraker_names <<< "$(get_multi_instance_names)" fi - # Next, check for any existing OctoEverywhere servcies. + # Next, check for any existing OctoEverywhere services. local octoeverywhere_services local existing_octoeverywhere_count octoeverywhere_services=$(octoeverywhere_systemd) @@ -55,7 +55,7 @@ function octoeverywhere_setup_dialog() { if (( allowed_octoeverywhere_count > 0 )); then local new_octoeverywhere_count - ### Step 1: Ask for the number of moonraker-obico instances to install + ### Step 1: Ask for the number of OctoEverywhere instances to install if (( moonraker_count == 1 )); then ok_msg "Moonraker installation found!\n" new_octoeverywhere_count=1 @@ -94,7 +94,7 @@ function octoeverywhere_setup_dialog() { (( new_octoeverywhere_count > allowed_octoeverywhere_count )) && error_msg "Number of OctoEverywhere instances larger than installed Moonraker instances" done && select_msg "${new_octoeverywhere_count}" else - log_error "Internal error. moonraker_count of '${moonraker_count}' not equal or grather than one!" + log_error "Internal error. moonraker_count of '${moonraker_count}' not equal or grater than one!" return 1 fi # (( moonraker_count == 1 )) fi # (( allowed_octoeverywhere_count > 0 )) @@ -103,7 +103,7 @@ function octoeverywhere_setup_dialog() { # If the user selects the install option again, they might be trying to recover the install # or complete a printer link they didn't finish in the past. # So in this case, we will allow them to run the install script again, since it's safe to run - # if the service is already installed, it will rpaire any missing issues. + # if the service is already installed, it will repair any missing issues. if (( allowed_octoeverywhere_count == 0 && moonraker_count == 1 )); then local yn while true; do @@ -128,13 +128,13 @@ function octoeverywhere_setup_dialog() { allowed_octoeverywhere_count=1 fi - # If there's something to intall, do it! + # If there's something to install, do it! if (( allowed_octoeverywhere_count > 0 )); then (( new_octoeverywhere_count > 1 )) && status_msg "Installing ${new_octoeverywhere_count} OctoEverywhere instances ..." (( new_octoeverywhere_count == 1 )) && status_msg "Installing OctoEverywhere ..." - # Ensure the basic system depdencies are installed. + # Ensure the basic system dependencies are installed. local dep=(git dfu-util virtualenv python3 python3-pip python3-venv) dependency_check "${dep[@]}" @@ -178,7 +178,7 @@ function octoeverywhere_install() { } #===================================================# -#============= REMOVE MOONRAKER-OBICO ==============# +#============= Remove ==============# #===================================================# function remove_octoeverywhere_systemd() { @@ -268,7 +268,7 @@ function remove_octoeverywhere() } #===================================================# -#============= UPDATE MOONRAKER-OBICO ==============# +#============= UPDATE ==============# #===================================================# function update_octoeverywhere() { @@ -278,7 +278,7 @@ function update_octoeverywhere() { } #===================================================# -#============= MOONRAKER-OBICO STATUS ==============# +#============= STATUS ==============# #===================================================# function get_octoeverywhere_status() { -- 2.39.5 From ac4a9a1ae3f5ae93e82a31b80d5006294c4dd7b0 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sat, 4 Mar 2023 16:35:44 +0100 Subject: [PATCH 5/9] fix(octoeverywhere): fix typo in link Signed-off-by: Dominik Willner --- scripts/octoeverywhere.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh index 53c9692..1deaf43 100644 --- a/scripts/octoeverywhere.sh +++ b/scripts/octoeverywhere.sh @@ -12,7 +12,7 @@ # # This file is written and maintained by Quinn Damerell from OctoEverywhere # Please contact our support team if you need any help! -# https://octoeverywhre.com/support +# https://octoeverywhere.com/support # set -e -- 2.39.5 From 169bbdf420d98bd6edfaae599380aab9fcdefef5 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sat, 4 Mar 2023 16:52:34 +0100 Subject: [PATCH 6/9] chore(octoeverywhere): fix menu layouts Signed-off-by: Dominik Willner --- scripts/ui/install_menu.sh | 16 ++++++++-------- scripts/ui/main_menu.sh | 32 ++++++++++++++++---------------- scripts/ui/update_menu.sh | 4 ++-- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/scripts/ui/install_menu.sh b/scripts/ui/install_menu.sh index 9db0030..c4a5820 100755 --- a/scripts/ui/install_menu.sh +++ b/scripts/ui/install_menu.sh @@ -20,16 +20,16 @@ function install_ui() { echo -e "| functions on a completely fresh system. |" hr echo -e "| Firmware & API: | 3rd Party Webinterface: |" - echo -e "| 1) [Klipper] | 6) [OctoPrint] |" + echo -e "| 1) [Klipper] | 6) [OctoPrint] |" echo -e "| 2) [Moonraker] | |" echo -e "| | Other: |" - echo -e "| Klipper Webinterface: | 7) [PrettyGCode] |" - echo -e "| 3) [Mainsail] | 8) [Telegram Bot] |" - echo -e "| 4) [Fluidd] | 9) $(obico_install_title)|" - echo -e "| | 10) [OctoEverywhere For Klipper] |" - echo -e "| | |" - echo -e "| Touchscreen GUI: | Webcam Streamer: |" - echo -e "| 5) [KlipperScreen] | 11) [Crowsnest] |" + echo -e "| Klipper Webinterface: | 7) [PrettyGCode] |" + echo -e "| 3) [Mainsail] | 8) [Telegram Bot] |" + echo -e "| 4) [Fluidd] | 9) $(obico_install_title) |" + echo -e "| | 10) [OctoEverywhere] |" + echo -e "| Touchscreen GUI: | |" + echo -e "| 5) [KlipperScreen] | Webcam Streamer: |" + echo -e "| | 11) [Crowsnest] |" back_footer } diff --git a/scripts/ui/main_menu.sh b/scripts/ui/main_menu.sh index 56d868e..d9f3b38 100755 --- a/scripts/ui/main_menu.sh +++ b/scripts/ui/main_menu.sh @@ -19,21 +19,21 @@ function main_ui() { top_border echo -e "| $(title_msg "~~~~~~~~~~~~~~~ [ Main Menu ] ~~~~~~~~~~~~~~~") |" hr - echo -e "| 0) [Log-Upload] | Klipper: $(print_status "klipper")|" - echo -e "| | Repo: $(print_klipper_repo)|" - echo -e "| 1) [Install] | |" - echo -e "| 2) [Update] | Moonraker: $(print_status "moonraker")|" - echo -e "| 3) [Remove] | |" - echo -e "| 4) [Advanced] | Mainsail: $(print_status "mainsail")|" -# echo -e "| 5) [Backup] | Fluidd: $(print_status "fluidd")|" - echo -e "| | Fluidd: $(print_status "fluidd")|" - echo -e "| | KlipperScreen: $(print_status "klipperscreen")|" - echo -e "| 6) [Settings] | Telegram Bot: $(print_status "telegram_bot")|" - echo -e "| | Crowsnest: $(print_status "crowsnest")|" - echo -e "| | Obico: $(print_status "moonraker_obico")|" - echo -e "| |OctoEverywhere: $(print_status "octoeverywhere")|" - echo -e "| | |" - echo -e "| $(print_kiauh_version)| Octoprint: $(print_status "octoprint")|" + echo -e "| 0) [Log-Upload] | Klipper: $(print_status "klipper")|" + echo -e "| | Repo: $(print_klipper_repo)|" + echo -e "| 1) [Install] | |" + echo -e "| 2) [Update] | Moonraker: $(print_status "moonraker")|" + echo -e "| 3) [Remove] | |" + echo -e "| 4) [Advanced] | Mainsail: $(print_status "mainsail")|" +# echo -e "| 5) [Backup] | Fluidd: $(print_status "fluidd")|" + echo -e "| | Fluidd: $(print_status "fluidd")|" + echo -e "| | KlipperScreen: $(print_status "klipperscreen")|" + echo -e "| 6) [Settings] | Telegram Bot: $(print_status "telegram_bot")|" + echo -e "| | Crowsnest: $(print_status "crowsnest")|" + echo -e "| | Obico: $(print_status "moonraker_obico")|" + echo -e "| | OctoEverywhere: $(print_status "octoeverywhere")|" + echo -e "| | |" + echo -e "| $(print_kiauh_version)| Octoprint: $(print_status "octoprint")|" quit_footer } @@ -46,7 +46,7 @@ function get_kiauh_version() { function print_kiauh_version() { local version - version="$(printf "%-18s" "$(get_kiauh_version)")" + version="$(printf "%-16s" "$(get_kiauh_version)")" echo "${cyan}${version}${white}" } diff --git a/scripts/ui/update_menu.sh b/scripts/ui/update_menu.sh index 15ec0e9..26a51e8 100755 --- a/scripts/ui/update_menu.sh +++ b/scripts/ui/update_menu.sh @@ -33,9 +33,9 @@ function update_ui() { echo -e "| 7) [Telegram Bot] |$(compare_telegram_bot_versions)|" echo -e "| 8) [Obico for Klipper]|$(compare_moonraker_obico_versions)|" echo -e "| 9) [OctoEverywhere] |$(compare_octoeverywhere_versions)|" - echo -e "| 10)[Crowsnest] |$(compare_crowsnest_versions)|" + echo -e "| 10) [Crowsnest] |$(compare_crowsnest_versions)|" echo -e "| |------------------------------|" - echo -e "| 11)[System] | $(check_system_updates) |" + echo -e "| 11) [System] | $(check_system_updates) |" back_footer } -- 2.39.5 From de39039064ad707f0fa215d98cc5beb9749ba7a7 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sat, 4 Mar 2023 18:34:47 +0100 Subject: [PATCH 7/9] chore(octoeverywhere): clean up installer Signed-off-by: Dominik Willner --- scripts/octoeverywhere.sh | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh index 1deaf43..79e05ac 100644 --- a/scripts/octoeverywhere.sh +++ b/scripts/octoeverywhere.sh @@ -28,7 +28,7 @@ function octoeverywhere_systemd() { } function octoeverywhere_setup_dialog() { - echo -e "\n${magenta}OctoEverywhere Free & Unlimited Remote Access To Mainsail Or Fluidd... Everywhere!\nNow including free and unlimited AI print failure detection!\n${white}" + status_msg "Initializing OctoEverywhere for Klipper installation ..." # First, check for moonraker service instances. local moonraker_count @@ -200,7 +200,7 @@ function remove_octoeverywhere_systemd() { } function remove_octoeverywhere_logs() { - local files regex="\/home\/${USER}\/([A-Za-z0-9_]+)\/logs\/octoeverywhere(-[0-9a-zA-Z]+)?\.log(.*)?" + local files regex="${HOME//\//\\/}\/([A-Za-z0-9_]+)\/logs\/octoeverywhere(-[0-9a-zA-Z]+)?\.log(.*)?" files=$(find "${HOME}" -maxdepth 3 -regextype posix-extended -regex "${regex}" | sort) if [[ -n ${files} ]]; then @@ -220,22 +220,9 @@ function remove_octoeverywhere_dir() { ok_msg "Directory removed!" } -function remove_octoeverywhere_logs() { - local files regex="\/home\/${USER}\/([A-Za-z0-9_]+)\/logs\/octoeverywhere(-[0-9a-zA-Z]+)?\.log(.*)?" - files=$(find "${HOME}" -maxdepth 3 -regextype posix-extended -regex "${regex}" | sort) - - if [[ -n ${files} ]]; then - for file in ${files}; do - status_msg "Removing ${file} ..." - rm -f "${file}" - ok_msg "${file} removed!" - done - fi -} - function remove_octoeverywhere_config() { # Remove the system config but not the main config, so the printer id doesn't get lost. - local files regex="\/home\/${USER}\/([A-Za-z0-9_]+)\/logs\/octoeverywhere-system(-[0-9a-zA-Z]+)?\.cfg(.*)?" + local files regex="${HOME//\//\\/}\/([A-Za-z0-9_]+)\/config\/octoeverywhere-system(-[0-9a-zA-Z]+)?\.cfg(.*)?" files=$(find "${HOME}" -maxdepth 4 -regextype posix-extended -regex "${regex}" | sort) if [[ -n ${files} ]]; then @@ -284,7 +271,6 @@ function update_octoeverywhere() { function get_octoeverywhere_status() { local status local service_count - local is_linked local octoeverywhere_services octoeverywhere_services=$(octoeverywhere_systemd) -- 2.39.5 From 7356d199abfad2316f6b6dcf6274709f540e26f0 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sat, 4 Mar 2023 19:36:48 +0100 Subject: [PATCH 8/9] feat(octoeverywhere): remove store dir during uninstall Signed-off-by: Dominik Willner --- scripts/octoeverywhere.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh index 79e05ac..1185603 100644 --- a/scripts/octoeverywhere.sh +++ b/scripts/octoeverywhere.sh @@ -234,6 +234,19 @@ function remove_octoeverywhere_config() { fi } +function remove_octoeverywhere_store_dir() { + local files regex="${HOME//\//\\/}\/([A-Za-z0-9_]+)\/octoeverywhere-store" + files=$(find "${HOME}" -maxdepth 2 -type d -regextype posix-extended -regex "${regex}" | sort) + + if [[ -n ${files} ]]; then + for file in ${files}; do + status_msg "Removing ${file} ..." + rm -rf "${file}" + ok_msg "${file} removed!" + done + fi +} + function remove_octoeverywhere_env() { [[ ! -d "${HOME}octoeverywhere-env" ]] && return @@ -249,6 +262,7 @@ function remove_octoeverywhere() remove_octoeverywhere_dir remove_octoeverywhere_env remove_octoeverywhere_config + remove_octoeverywhere_store_dir print_confirm "OctoEverywhere was successfully removed!" return -- 2.39.5 From 9de67d4777044b3378190d451716b3589235a3ce Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 5 Mar 2023 08:40:00 +0100 Subject: [PATCH 9/9] fix(octoeverywhere): typo in condition Signed-off-by: Dominik Willner --- scripts/octoeverywhere.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh index 1185603..6a2eb0f 100644 --- a/scripts/octoeverywhere.sh +++ b/scripts/octoeverywhere.sh @@ -248,7 +248,7 @@ function remove_octoeverywhere_store_dir() { } function remove_octoeverywhere_env() { - [[ ! -d "${HOME}octoeverywhere-env" ]] && return + [[ ! -d "${HOME}/octoeverywhere-env" ]] && return status_msg "Removing octoeverywhere-env directory ..." rm -rf "${HOME}/octoeverywhere-env" -- 2.39.5