diff --git a/README.md b/README.md
index 4e24255..d662268 100644
--- a/README.md
+++ b/README.md
@@ -15,37 +15,91 @@
-
+
-## **🛠️ Instructions:**
+
-For downloading this script it is necessary to have git installed.\
-If you haven't, please run `sudo apt-get install git -y` to install git first.\
-After git is installed, use the following commands in the given order to download and execute the script:
+
+ 📄️ Instructions 📄
+
-```shell
-cd ~
+### 📋 Prerequisites
+KIAUH is a script that assists you in installing Klipper on a Linux operating system that has
+already been flashed to your Raspberry Pi's (or other SBC's) SD card. As a result, you must ensure
+that you have a functional Linux system on hand. `Raspberry Pi OS Lite (32bit)` is a recommended Linux image
+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.
-git clone https://github.com/th33xitus/kiauh.git
+* Once you downloaded, installed and launched the Raspberry Pi Imager
+select `Choose OS -> Raspberry Pi OS (other)`: \
+
+
+
-./kiauh/kiauh.sh
-```
+* Then select `Raspberry Pi OS Lite (32bit)`:
+
+
+
+
+* 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)
+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).
+
+These steps **only** apply if you are actually using a Raspberry Pi. In case you want
+to use a different SBC (like an Orange Pi or any other Pi derivates), please look up on how to get an appropriate Linux image flashed
+to the SD card before proceeding further (usually done with Balena Etcher in those cases). Also make sure that KIAUH will be able to run
+and operate on the Linux Distribution you are going to flash. You likely will have the most success with
+distributions based on Debian 11 Bullseye. Read the notes further down below in this document.
+
+### 💾 Download and use KIAUH
**📢 Disclaimer: Usage of this script happens at your own risk!**
+* **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
+```
-## **❗ Notes:**
+* **Step 2:** \
+Once git is installed, use the following command to download KIAUH into your home-directoy:
-**📋 Please see the [Changelog](docs/changelog.md) for possible important changes!**
+```shell
+cd ~ && git clone https://github.com/th33xitus/kiauh.git
+```
-- Tested **only** on Raspberry Pi OS Lite (Debian 10 Buster)
- - Other Debian based distributions can work
- - Reported to work on Armbian too
-- During the use of this script you might be asked for your sudo password. There are several functions involved which need sudo privileges.
+* **Step 3:** \
+Finally start KIAUH by running the next command:
-## **🌐 Sources & Further Information**
+```shell
+./kiauh/kiauh.sh
+```
+
+* **Step 4:** \
+You should now find yourself in the main menu of KIAUH. You will see several actions to choose from depending
+on what you want to do. To choose an action, simply type the corresponding number into the "Perform action"
+prompt and confirm by hitting ENTER.
+
+
+
+❗ Notes ❗
+
+### **📋 Please see the [Changelog](docs/changelog.md) for possible important changes!**
+
+- Mainly tested on Raspberry Pi OS Lite (Debian 10 Buster / Debian 11 Bullseye)
+ - Other Debian based distributions (like Ubuntu 20 to 22) likely work too
+ - Reported to work on Armbian as well but not tested in detail
+- During the use of this script you will be asked for your sudo password. There are several functions involved which need sudo privileges.
+
+
+
+🌐 Sources & Further Information
-## **Credits**
+
+
+✨ Credits ✨
* 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) !
+* 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!
diff --git a/kiauh.sh b/kiauh.sh
index 8d40d98..c0fed70 100755
--- a/kiauh.sh
+++ b/kiauh.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
@@ -9,13 +9,8 @@
# This file may be distributed under the terms of the GNU GPLv3 license #
#=======================================================================#
-# TODO: mjpg-streamer
-# TODO: moonraker-telegram-bot
-# TODO: obico
-# TODO: pretty_gcode
# TODO: upload_log
# TODO: all backup functions
-# TODO: octoprint
# TODO: doublecheck that nothing got missed!
set -e
diff --git a/resources/screenshots/rpi_imager1.png b/resources/screenshots/rpi_imager1.png
new file mode 100644
index 0000000..1e51b8b
Binary files /dev/null and b/resources/screenshots/rpi_imager1.png differ
diff --git a/resources/screenshots/rpi_imager2.png b/resources/screenshots/rpi_imager2.png
new file mode 100644
index 0000000..9b46e02
Binary files /dev/null and b/resources/screenshots/rpi_imager2.png differ
diff --git a/scripts/backup.sh b/scripts/backup.sh
index 1f07d48..dc51d22 100755
--- a/scripts/backup.sh
+++ b/scripts/backup.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/crowsnest.sh b/scripts/crowsnest.sh
index 2915e55..ef123cc 100644
--- a/scripts/crowsnest.sh
+++ b/scripts/crowsnest.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/flash_klipper.sh b/scripts/flash_klipper.sh
index f8677d1..8ea0ab8 100644
--- a/scripts/flash_klipper.sh
+++ b/scripts/flash_klipper.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/fluidd.sh b/scripts/fluidd.sh
index c6188c6..42fda1d 100644
--- a/scripts/fluidd.sh
+++ b/scripts/fluidd.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/gcode_shell_command.sh b/scripts/gcode_shell_command.sh
index f07747f..48d52a2 100644
--- a/scripts/gcode_shell_command.sh
+++ b/scripts/gcode_shell_command.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/globals.sh b/scripts/globals.sh
index 81629d6..b8c877e 100644
--- a/scripts/globals.sh
+++ b/scripts/globals.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
@@ -69,6 +69,10 @@ function set_globals() {
MOONRAKER_OBICO_DIR="${HOME}/moonraker-obico"
MOONRAKER_OBICO_REPO="https://github.com/TheSpaghettiDetective/moonraker-obico.git"
+ #=============== OCTOEVERYWHERE ================#
+ 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/klipper.sh b/scripts/klipper.sh
index 9822371..5a6e289 100644
--- a/scripts/klipper.sh
+++ b/scripts/klipper.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/klipperscreen.sh b/scripts/klipperscreen.sh
index 7c302fe..65ac223 100644
--- a/scripts/klipperscreen.sh
+++ b/scripts/klipperscreen.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/mainsail.sh b/scripts/mainsail.sh
index 216fa58..ff53ad3 100644
--- a/scripts/mainsail.sh
+++ b/scripts/mainsail.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/mjpg-streamer.sh b/scripts/mjpg-streamer.sh
index 5317d0b..a94203e 100644
--- a/scripts/mjpg-streamer.sh
+++ b/scripts/mjpg-streamer.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/moonraker-telegram-bot.sh b/scripts/moonraker-telegram-bot.sh
index 3ad92bf..7aab1e9 100644
--- a/scripts/moonraker-telegram-bot.sh
+++ b/scripts/moonraker-telegram-bot.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/moonraker.sh b/scripts/moonraker.sh
index 363c70b..674e09c 100644
--- a/scripts/moonraker.sh
+++ b/scripts/moonraker.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/nginx.sh b/scripts/nginx.sh
index 15eaab6..fac0948 100644
--- a/scripts/nginx.sh
+++ b/scripts/nginx.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/obico.sh b/scripts/obico.sh
index 92d5b3f..a831188 100644
--- a/scripts/obico.sh
+++ b/scripts/obico.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh
new file mode 100644
index 0000000..5607ff8
--- /dev/null
+++ b/scripts/octoeverywhere.sh
@@ -0,0 +1,339 @@
+#!/usr/bin/env bash
+
+#=======================================================================#
+# Copyright (C) 2020 - 2023 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 maintained by Quinn Damerell from OctoEverywhere
+# Please contact our support team if you need any help!
+# https://octoeverywhere.com/support
+#
+
+set -e
+
+#===================================================#
+#============== Install ============#
+#===================================================#
+
+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() {
+ status_msg "Initializing OctoEverywhere for Klipper installation ..."
+
+ # 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 services.
+ 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 OctoEverywhere 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 grater 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 repair 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 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 dependencies 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 ==============#
+#===================================================#
+
+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//\//\\/}\/([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_config() {
+ # Remove the system config but not the main config, so the printer id doesn't get lost.
+ 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
+ for file in ${files}; do
+ status_msg "Removing ${file} ..."
+ rm -f "${file}"
+ ok_msg "${file} removed!"
+ done
+ 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
+
+ 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
+ remove_octoeverywhere_store_dir
+
+ print_confirm "OctoEverywhere was successfully removed!"
+ return
+}
+
+#===================================================#
+#============= UPDATE ==============#
+#===================================================#
+
+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"
+}
+
+#===================================================#
+#============= STATUS ==============#
+#===================================================#
+
+function get_octoeverywhere_status() {
+ local status
+ local service_count
+ 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/octoprint.sh b/scripts/octoprint.sh
index b819373..9f9e90e 100644
--- a/scripts/octoprint.sh
+++ b/scripts/octoprint.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/pretty_gcode.sh b/scripts/pretty_gcode.sh
index 8d27bb5..7ace8ff 100644
--- a/scripts/pretty_gcode.sh
+++ b/scripts/pretty_gcode.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/rollback.sh b/scripts/rollback.sh
index b2b54bc..09ee99f 100755
--- a/scripts/rollback.sh
+++ b/scripts/rollback.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/switch_klipper_repo.sh b/scripts/switch_klipper_repo.sh
index 8739250..34e3855 100644
--- a/scripts/switch_klipper_repo.sh
+++ b/scripts/switch_klipper_repo.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/ui/advanced_menu.sh b/scripts/ui/advanced_menu.sh
index e4dbf39..2e2bc5c 100755
--- a/scripts/ui/advanced_menu.sh
+++ b/scripts/ui/advanced_menu.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/ui/backup_menu.sh b/scripts/ui/backup_menu.sh
index 2654069..c908b44 100755
--- a/scripts/ui/backup_menu.sh
+++ b/scripts/ui/backup_menu.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/ui/general_ui.sh b/scripts/ui/general_ui.sh
index d0dc9f2..b74c31f 100755
--- a/scripts/ui/general_ui.sh
+++ b/scripts/ui/general_ui.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/ui/install_menu.sh b/scripts/ui/install_menu.sh
index c17942f..2ebcc00 100755
--- a/scripts/ui/install_menu.sh
+++ b/scripts/ui/install_menu.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
@@ -26,9 +26,10 @@ function install_ui() {
echo -e "| Klipper Webinterface: | 7) [PrettyGCode] |"
echo -e "| 3) [Mainsail] | 8) [Telegram Bot] |"
echo -e "| 4) [Fluidd] | 9) $(obico_install_title) |"
- echo -e "| | |"
- echo -e "| Touchscreen GUI: | Webcam Streamer: |"
- echo -e "| 5) [KlipperScreen] | 10) [Crowsnest] |"
+ echo -e "| | 10) [OctoEverywhere] |"
+ echo -e "| Touchscreen GUI: | |"
+ echo -e "| 5) [KlipperScreen] | Webcam Streamer: |"
+ echo -e "| | 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..b04a090 100755
--- a/scripts/ui/main_menu.sh
+++ b/scripts/ui/main_menu.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
@@ -19,20 +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 "| | |"
- 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
}
@@ -45,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/remove_menu.sh b/scripts/ui/remove_menu.sh
index d7408d0..0749921 100755
--- a/scripts/ui/remove_menu.sh
+++ b/scripts/ui/remove_menu.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
@@ -28,7 +28,8 @@ function remove_ui() {
echo -e "| 6) [Fluidd-Config] | 11) [PrettyGCode] |"
echo -e "| | 12) [Telegram Bot] |"
echo -e "| Touchscreen GUI: | 13) [Obico for Klipper] |"
- echo -e "| 7) [KlipperScreen] | 14) [NGINX] |"
+ echo -e "| 7) [KlipperScreen] | 14) [OctoEverywhere] |"
+ echo -e "| | 15) [NGINX] |"
back_footer
}
@@ -66,6 +67,8 @@ function remove_menu() {
13)
do_action "remove_moonraker_obico" "remove_ui";;
14)
+ do_action "remove_octoeverywhere" "remove_ui";;
+ 15)
do_action "remove_nginx" "remove_ui";;
B|b)
clear; main_menu; break;;
diff --git a/scripts/ui/settings_menu.sh b/scripts/ui/settings_menu.sh
index 3146102..27c9dad 100755
--- a/scripts/ui/settings_menu.sh
+++ b/scripts/ui/settings_menu.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/ui/update_menu.sh b/scripts/ui/update_menu.sh
index 8e7f7a9..f060536 100755
--- a/scripts/ui/update_menu.sh
+++ b/scripts/ui/update_menu.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
@@ -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";;
diff --git a/scripts/upload_log.sh b/scripts/upload_log.sh
index e9f06f7..2e23636 100755
--- a/scripts/upload_log.sh
+++ b/scripts/upload_log.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
diff --git a/scripts/utilities.sh b/scripts/utilities.sh
index 3bcc8d2..b43d0d3 100644
--- a/scripts/utilities.sh
+++ b/scripts/utilities.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#=======================================================================#
-# Copyright (C) 2020 - 2022 Dominik Willner #
+# Copyright (C) 2020 - 2023 Dominik Willner #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #