#!/bin/bash CHECK_FOR_ROOT=$(whoami) if [ "$CHECK_FOR_ROOT" != "root" ]; then echo 'This must be run as root! Try again!' exit fi /usr/sbin/a2ensite proxy echo " Listen 8081 http NameVirtualHost *:8081 " >> /etc/apache2/ports.conf /etc/init.d/apache2 restart check=$(sudo netstat -pln | grep -i apache | grep -i 8081) if [ -n "${check}" ]; then echo "proxy set up" else echo "something wen't wrong" fi