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