#!/bin/bash

# See if slip is up
# Start it up if it is not

if [ ! -f /var/log/watch-slip.log ]; then
        touch /var/log/watch-slip.log
fi

while /bin/true; do
	ifconfig | grep sl0 2>&1 > /dev/null
	if [ $? -eq 1 ]; then
	        echo "SLIP down at $(date)" >> /var/log/watch-slip.log
	        /etc/sysconfig/network-scripts/ifup-sl0 >> /var/run/watch-slip.log 2>&1
		exit 0
	fi
	sleep 120
done
