From ba888b1f97d07bcde374bf5b8811bf3f892ed2a9 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Thu, 11 Nov 2021 12:51:09 +0100 Subject: [PATCH] chore: use ls within remove_nginx method --- scripts/remove.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/remove.sh b/scripts/remove.sh index 29af7d0..d53ebf1 100755 --- a/scripts/remove.sh +++ b/scripts/remove.sh @@ -364,12 +364,10 @@ remove_octoprint(){ ############################################################# remove_nginx(){ - if [[ $(dpkg-query -f'${Status}' --show nginx 2>/dev/null) = *\ installed ]] ; then - 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 + if ls /lib/systemd/system/nginx.service 2>/dev/null 1>&2; then + status_msg "Stopping Nginx service ..." + sudo systemctl stop nginx && sudo systemctl disable nginx + ok_msg "Service stopped and disabled!" status_msg "Purging Nginx from system ..." sudo apt-get purge nginx nginx-common -y sudo update-rc.d -f nginx remove