mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 19:14:27 +05:00
fix: cleaner nginx removal process
This commit is contained in:
@@ -173,16 +173,14 @@ remove_octoprint(){
|
|||||||
|
|
||||||
remove_nginx(){
|
remove_nginx(){
|
||||||
if [[ $(dpkg-query -f'${Status}' --show nginx 2>/dev/null) = *\ installed ]] ; then
|
if [[ $(dpkg-query -f'${Status}' --show nginx 2>/dev/null) = *\ installed ]] ; then
|
||||||
status_msg "Stopping and removing Nginx Service ..."
|
if systemctl is-active nginx -q; then
|
||||||
if [ -e /etc/init.d/nginx ]; then
|
status_msg "Stopping Nginx service ..."
|
||||||
sudo /etc/init.d/nginx stop && ok_msg "Nginx Service stopped!"
|
sudo service nginx stop && sudo systemctl disable nginx
|
||||||
sudo rm /etc/init.d/nginx && ok_msg "Nginx Service removed!"
|
ok_msg "Service stopped!"
|
||||||
fi
|
|
||||||
if [ -e /etc/default/nginx ]; then
|
|
||||||
sudo rm /etc/default/nginx
|
|
||||||
fi
|
fi
|
||||||
status_msg "Purging Nginx from system ..."
|
status_msg "Purging Nginx from system ..."
|
||||||
sudo apt-get purge nginx nginx-common -y
|
sudo apt-get purge nginx nginx-common -y
|
||||||
|
sudo update-rc.d -f nginx remove
|
||||||
CONFIRM_MSG=" Nginx successfully removed!"
|
CONFIRM_MSG=" Nginx successfully removed!"
|
||||||
else
|
else
|
||||||
ERROR_MSG=" Looks like Nginx was already removed!\n Skipping..."
|
ERROR_MSG=" Looks like Nginx was already removed!\n Skipping..."
|
||||||
|
|||||||
Reference in New Issue
Block a user