#!/bin/bash
#
# by: Brian Butler (20100902)
#
# Cleanup script for the Morris Worm and Fish Supply Company case study
# this script is to be installed and run on serverX.example.com
# output is logged to syslog

# Set environment and declare global variables
. /usr/local/lib/labtool.shlib
trap on_exit EXIT
trap cleanup TERM
LOG_FACILITY=local0
LOG_PRIORITY=info
LOG_TAG=sambaLab
DEBUG=false
ERROR_MESSAGE="Error running script. Contact your instructor if you continue to see this message."
PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
userInput="no"
set -o pipefail

# Restore desktopX's firewall rules and reset vserver to classroom network
([ -f /root/iptables ] && cp -a /root/iptables /etc/sysconfig/iptables 2>&1 | log || rm /etc/sysconfig/iptables 2>&1 | log)
(service iptables restart 2>&1 | log)
(gls-vserver-network --classroom 2>&1 | log)
