Commit ba81efe0 by irul

Update server_info.sh

1 parent 47db2698
...@@ -127,7 +127,7 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then ...@@ -127,7 +127,7 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then
#echo "== Sites Available =="; #echo "== Sites Available ==";
#echo -e `apache2ctl -S 2>&1 | grep "namevhost" | awk '{print "(" NR ") " $4}'` #echo -e `apache2ctl -S 2>&1 | grep "namevhost" | awk '{print "(" NR ") " $4}'`
SITES=$(echo `apache2ctl -S 2>&1 |grep "sites-en"|cut -d"/" -f5|cut -d ":" -f1|rev|cut -d"." -f2-|rev|grep -v "default"|uniq -u|sort`) SITES=$(echo `apache2ctl -S 2>&1 |grep "sites-en"|cut -d"/" -f5|cut -d ":" -f1|rev|cut -d"." -f2-|rev|grep -v "default"|uniq|sort`)
if [ ! -z "$SITES" ] ; then if [ ! -z "$SITES" ] ; then
echo "== Sites Available (Apache) =="; echo "== Sites Available (Apache) ==";
...@@ -146,7 +146,7 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then ...@@ -146,7 +146,7 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then
fi fi
if dpkg --get-selections | grep -E '(^|\s)nginx($|\s)' &> /dev/null ; then if dpkg --get-selections | grep -E '(^|\s)nginx($|\s)' &> /dev/null ; then
SITES=$(echo `grep server_name /etc/nginx/sites-enabled/* -RiI|cut -d"/" -f5-|cut -d":" -f1|rev|cut -d"." -f2-|rev|grep -v "default"|sort|uniq`) SITES=$(echo `grep server_name /etc/nginx/sites-enabled/* -RiI|cut -d"/" -f5-|cut -d":" -f1|rev|cut -d"." -f2-|rev|grep -v "default"|grep -v "#"|grep -v "_;"|grep -v "server_name"|grep -v "example"|uniq|sort`)
if [ ! -z "$SITES" ] ; then if [ ! -z "$SITES" ] ; then
echo "== Sites Available (Nginx) =="; echo "== Sites Available (Nginx) ==";
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!