#!/bin/sh 
#
#
clear

if test "$UID" != "0" -a "$USER" != root -a -z "$ROOT" ; then
	echo ""
	echo "   Only superuser is allowed to start this script! Please become root before."
	echo ""
	exit 1
fi

echo "##################################################################################"
echo "  ATTENTION:"
echo "  This file uninstalls all files/directories of the firewall service completely."
echo "  If you really want to do this, call this script with the option '-yes'."
echo ""
echo "  Andreas Hochsteger <e9625392@student.tuwien.ac.at>"
echo "##################################################################################"
echo ""

sleep 2	 

if [ "$1" != "-yes" ]; then
	echo "Firewall service not uninstalled (see message above)."
	exit 1;
fi

dirs="/etc/firewall"
files="/etc/sysconfig/firewall /etc/init.d/firewall /usr/sbin/rcfirewall"

# Uninstall firewall service:
insserv -r firewall

# Delete all directories:
for dir in $dirs; do
	rm -rf $dir;
done

# Delete all files:
for file in $files; do
	rm -rf $file;
done

echo "  Startup script has been successfully uninstalled."

exit 0
