1#!/bin/mksh
2# $MirSecuCron$
3# $MirOS: src/etc/ppp/ip-up,v 1.7 2009/07/18 14:09:12 tg Exp $
4
5# This script is called when your ppp(8) or pppd(8) connection
6# goes up and after the connection, including routing, has al-
7# ready been established.
8
9
10### Samples
11
12## things to do before the state table gets flushed
13#ifconfig gif0 down		# if using an IPv6 tunnel
14
15## OpenIPF
16#pfctl -f /etc/pf.conf 2>&1	| logger -t pfctl-load
17#pfctl -i $1 -F state 2>&1	| logger -t pfctl-flush
18#pfctl -e >/dev/null 2>&1	# just in case...
19
20## get IPv4 address
21if [[ $4 = +([0-9]).+([0-9]).+([0-9]).+([0-9]) ]]; then
22	MYIP=$4
23else
24	MYIP=$(ifconfig $1 | grep "inet " | head -1 \
25	    | while read a b c; do print $b; done)
26fi
27
28## insert whatever stuff here
29