Commit d470f52a by irul

Update server_info.sh

1 parent ba81efe0
......@@ -29,7 +29,7 @@ echo -e "Server IP: "`/sbin/ip -4 a | grep "inet " | tail -n +2 | awk '{print "[
echo -e "Default Gateway: "`ip route show | sed 's/\(\S\+\s\+\)\?default via \(\S\+\).*/\2/p; d'`
echo ""
echo -e "HDD: "`lsblk -dio SIZE,KNAME,MODEL,TYPE | grep disk | awk {'print "["NR"] "$0'}`
echo -e "HDD: "`lsblk -dio SIZE,MODEL,KNAME,TYPE | grep disk|rev|cut -d" " -f2-|rev|awk {'print "["NR"] "$0'}`
echo -e "Memory(RAM): "`free -mht| awk '/Mem/{print $2 " |Used: "$3 " |Free: "$4 " |Available: "$7}'`
echo -e "Swap Memory: "`free -mht| awk '/Swap/{print $2 " |Used: "$3 " |Free: "$4}'`
echo ""
......@@ -127,7 +127,7 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then
#echo "== Sites Available ==";
#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|sort`)
SITES=$(echo `apache2ctl -S 2>&1 |grep "sites-en"|cut -d"/" -f5|cut -d ":" -f1|rev|cut -d"." -f2-|rev|grep -v "default"|sort|uniq`)
if [ ! -z "$SITES" ] ; then
echo "== Sites Available (Apache) ==";
......@@ -146,7 +146,7 @@ if dpkg --get-selections | grep -E '(^|\s)apache2($|\s)' &> /dev/null ; then
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"|grep -v "#"|grep -v "_;"|grep -v "server_name"|grep -v "example"|uniq|sort`)
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"|sort|uniq`)
if [ ! -z "$SITES" ] ; then
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!