diff --git a/kiauh.sh b/kiauh.sh index bc9a8eb..bfb28d9 100755 --- a/kiauh.sh +++ b/kiauh.sh @@ -265,6 +265,18 @@ remove_menu(){ remove_octoprint print_msg && CONFIRM_MSG="" && ERROR_MSG="" remove_ui;; + 5) + clear + print_header + remove_tornado + print_msg && CONFIRM_MSG="" && ERROR_MSG="" + remove_ui;; + 6) + clear + print_header + remove_nginx + print_msg && CONFIRM_MSG="" && ERROR_MSG="" + remove_ui;; Q|q) clear; main_menu; break;; *) diff --git a/scripts/remove.sh b/scripts/remove.sh index 8817de6..a404d97 100644 --- a/scripts/remove.sh +++ b/scripts/remove.sh @@ -26,6 +26,20 @@ remove_klipper(){ fi } +remove_tornado(){ + data_arr=( + $TORNADO_DIR1 + $TORNADO_DIR2 + ) + print_error "Tornado" && data_count=() + if [ "$ERROR_MSG" = "" ]; then + status_msg "Removing Tornado from klippy-env ..." + PYTHONDIR=$KLIPPY_ENV_DIR + $PYTHONDIR/bin/pip uninstall tornado -y + CONFIRM_MSG=" Tornado successfully removed!" + fi +} + remove_dwc2(){ data_arr=( $DWC2FK_DIR @@ -118,6 +132,8 @@ remove_octoprint(){ $OCTOPRINT_CFG_DIR ${HOME}/octoprint.log /etc/sudoers.d/octoprint-shutdown + /etc/nginx/sites-available/octoprint + /etc/nginx/sites-enabled/octoprint ) print_error "OctoPrint" && data_count=() if [ "$ERROR_MSG" = "" ]; then @@ -140,4 +156,22 @@ remove_octoprint(){ fi CONFIRM_MSG=" OctoPrint successfully removed!" fi +} + +remove_nginx(){ + if [[ $(dpkg-query -f'${Status}' --show nginx 2>/dev/null) = *\ installed ]] ; then + status_msg "Stopping and removing Nginx Service ..." + if [ -e /etc/init.d/nginx ]; then + sudo /etc/init.d/nginx stop && ok_msg "Nginx Service stopped!" + sudo rm /etc/init.d/nginx && ok_msg "Nginx Service removed!" + fi + if [ -e /etc/default/nginx ]; then + sudo rm /etc/default/nginx + fi + status_msg "Purging Nginx from system ..." + sudo apt-get purge nginx nginx-common -y + CONFIRM_MSG=" Nginx successfully removed!" + else + ERROR_MSG=" Looks like Nginx was already removed!\n Skipping..." + fi } \ No newline at end of file diff --git a/scripts/ui.sh b/scripts/ui.sh index 5f2c963..0a6ac30 100644 --- a/scripts/ui.sh +++ b/scripts/ui.sh @@ -94,8 +94,8 @@ remove_ui(){ echo -e "| --> ~/kiauh-backups | " echo -e "| You need remove them manually if you wish so. | " hr - echo -e "| 1) [Klipper] | | " - echo -e "| 2) [DWC2-for-Klipper] | | " + echo -e "| 1) [Klipper] | 5) [Tornado] | " + echo -e "| 2) [DWC2-for-Klipper] | 6) [Nginx] | " echo -e "| 3) [Mainsail] | | " echo -e "| 4) [Octoprint] | | " quit_footer