From 83e9618a756bfb654eab892ea703b924f7130a4f Mon Sep 17 00:00:00 2001 From: th33xitus <> Date: Fri, 11 Sep 2020 10:25:38 +0200 Subject: [PATCH] fix: cleaner nginx removal process --- scripts/remove.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/remove.sh b/scripts/remove.sh index 6f9a9f4..8919769 100755 --- a/scripts/remove.sh +++ b/scripts/remove.sh @@ -173,16 +173,14 @@ remove_octoprint(){ 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 + if systemctl is-active nginx -q; then + status_msg "Stopping Nginx service ..." + sudo service nginx stop && sudo systemctl disable nginx + ok_msg "Service stopped!" fi status_msg "Purging Nginx from system ..." sudo apt-get purge nginx nginx-common -y + sudo update-rc.d -f nginx remove CONFIRM_MSG=" Nginx successfully removed!" else ERROR_MSG=" Looks like Nginx was already removed!\n Skipping..."