Wednesday, August 17, 2011

How to use bash to find all used IP:s in your apache configs (following the debian config model)

for i in `ls /etc/apache2/sites-enabled/*.vhost`; do echo "Working file:$i"; echo "Servername:";grep "ServerName" $i | cut -c 16-40; echo "Ipaddress:";grep "<VirtualHost" $i|cut -c 14-27; done

No comments:

Post a Comment