Commit e4fa90a3 by irul

Add nginx sites info

1 parent 9b07e6c6
...@@ -114,7 +114,26 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then ...@@ -114,7 +114,26 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then
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 -u|sort`)
if [ ! -z "$SITES" ] ; then if [ ! -z "$SITES" ] ; then
echo "== Sites Available =="; echo "== Sites Available (Apache) ==";
SITES_CNT=1
for SITE in $SITES
do
if curl -I "$SITE" 2>&1 | grep -w "200\|301" > /dev/null ; then
echo "$SITES_CNT $SITE is up"
else
echo "$SITES_CNT $SITE is down"
fi
SITES_CNT=$[$SITES_CNT +1]
done
echo ""
fi
fi
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`)
if [ ! -z "$SITES" ] ; then
echo "== Sites Available (Nginx) ==";
SITES_CNT=1 SITES_CNT=1
for SITE in $SITES for SITE in $SITES
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!