From 21c10b8998a628123a565c5c6c2fdb860e22e79a Mon Sep 17 00:00:00 2001 From: FatihGvn Date: Fri, 17 Feb 2023 21:23:41 +0300 Subject: [PATCH] remove virtualhost domain name from hosts file --- system/bin/remove-conf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/system/bin/remove-conf b/system/bin/remove-conf index 06ec549..8ba9870 100755 --- a/system/bin/remove-conf +++ b/system/bin/remove-conf @@ -9,8 +9,10 @@ then rm -v /etc/apache2/sites-available/$1.conf fi -if [ -f "/usr/local/apachep/system/hosts/ssl.$1.conf" ] +if [ -n "$(grep $1 /etc/hosts)" ] then - rm -v /usr/local/apachep/system/hosts/ssl.$1.conf - rm -v /etc/apache2/sites-available/ssl.$1.conf -fi + echo "$1 Found in your hosts, Removing now..."; + sed -i "/$1/d" /etc/hosts +else + echo "$1 was not found in your hosts"; +fi \ No newline at end of file