#!/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/a2dissite proxy sed -i '/8080/d' /etc/apache2/ports.conf /etc/init.d/apache2 restart check=$(sudo netstat -pln | grep -i apache | grep -i 8080) if [ -z "${check}" ]; then echo "proxy torn down" else echo "something wen't wrong" fi