mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 02:54:28 +05:00
feature: remove option for tornado and nginx
This commit is contained in:
12
kiauh.sh
12
kiauh.sh
@@ -265,6 +265,18 @@ remove_menu(){
|
|||||||
remove_octoprint
|
remove_octoprint
|
||||||
print_msg && CONFIRM_MSG="" && ERROR_MSG=""
|
print_msg && CONFIRM_MSG="" && ERROR_MSG=""
|
||||||
remove_ui;;
|
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)
|
Q|q)
|
||||||
clear; main_menu; break;;
|
clear; main_menu; break;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -26,6 +26,20 @@ remove_klipper(){
|
|||||||
fi
|
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(){
|
remove_dwc2(){
|
||||||
data_arr=(
|
data_arr=(
|
||||||
$DWC2FK_DIR
|
$DWC2FK_DIR
|
||||||
@@ -118,6 +132,8 @@ remove_octoprint(){
|
|||||||
$OCTOPRINT_CFG_DIR
|
$OCTOPRINT_CFG_DIR
|
||||||
${HOME}/octoprint.log
|
${HOME}/octoprint.log
|
||||||
/etc/sudoers.d/octoprint-shutdown
|
/etc/sudoers.d/octoprint-shutdown
|
||||||
|
/etc/nginx/sites-available/octoprint
|
||||||
|
/etc/nginx/sites-enabled/octoprint
|
||||||
)
|
)
|
||||||
print_error "OctoPrint" && data_count=()
|
print_error "OctoPrint" && data_count=()
|
||||||
if [ "$ERROR_MSG" = "" ]; then
|
if [ "$ERROR_MSG" = "" ]; then
|
||||||
@@ -140,4 +156,22 @@ remove_octoprint(){
|
|||||||
fi
|
fi
|
||||||
CONFIRM_MSG=" OctoPrint successfully removed!"
|
CONFIRM_MSG=" OctoPrint successfully removed!"
|
||||||
fi
|
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
|
||||||
}
|
}
|
||||||
@@ -94,8 +94,8 @@ remove_ui(){
|
|||||||
echo -e "| --> ~/kiauh-backups | "
|
echo -e "| --> ~/kiauh-backups | "
|
||||||
echo -e "| You need remove them manually if you wish so. | "
|
echo -e "| You need remove them manually if you wish so. | "
|
||||||
hr
|
hr
|
||||||
echo -e "| 1) [Klipper] | | "
|
echo -e "| 1) [Klipper] | 5) [Tornado] | "
|
||||||
echo -e "| 2) [DWC2-for-Klipper] | | "
|
echo -e "| 2) [DWC2-for-Klipper] | 6) [Nginx] | "
|
||||||
echo -e "| 3) [Mainsail] | | "
|
echo -e "| 3) [Mainsail] | | "
|
||||||
echo -e "| 4) [Octoprint] | | "
|
echo -e "| 4) [Octoprint] | | "
|
||||||
quit_footer
|
quit_footer
|
||||||
|
|||||||
Reference in New Issue
Block a user