#!/bin/bash

# Location: /usr/local/bin/vpn
# Usage: vpn "ppp0" "10.0.0.1" "connection name"

# /etc/crontab
# * *	* * *	root	/usr/local/bin/vpn "ppp0" "10.0.0.1" "vpnconn" >/dev/null

if ! /sbin/ifconfig $1 | grep -q "$2"
then
	/usr/bin/poff $3
	/usr/bin/pon $3
fi