The Punisher

rc.local script for the Dell Inspiron 8500

For whatever reason the onboard nic doesn't want to come up and get itself a dynamic IP address at boot time. So this rc.local forces the rc.inet1 script to try again if the box doesn't get an address.

Once it has an IP address this script also makes sure that the firewall and Snort also get started.

If DHCP does come up at first boot for some reason, then the firewall and Snort will also be going.

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local setup commands in here:
# Start eth0 since it refuses to do so on boot first time

DPID=`/usr/bin/pgrep dhcp`
if [ $DPID > 0 ]; then
echo "DHCP Started already"
sh /etc/rc.d/rc.iptables start
sh /etc/rc.d/rc.snort start
else
	if [ -x /etc/rc.d/rc.inet1 ]; then
		sh /etc/rc.d/rc.inet1
	fi
	DPID=`/usr/bin/pgrep dhcp`
	if [ $DPID > 0 ]; then
		sh /etc/rc.d/rc.iptables start
		sh /etc/rc.d/rc.snort start
	else
		echo "Interface not up";
	fi
fi

setterm -bfreq 0
.: If you want to converse with me contact punisher at my domain :.
Valid HTML 4.01! Valid CSS! Use Perl! GeoURL