1
|
#!/bin/sh
|
2
|
|
3
|
# let the configuration system know that the ip has changed.
|
4
|
/bin/echo $4 > /tmp/$1_router
|
5
|
/bin/echo $3 > /tmp/$1_ip
|
6
|
/usr/bin/touch /tmp/$1up
|
7
|
|
8
|
ALLOWOVERRIDE=`/usr/bin/grep dnsallowoverride /conf/config.xml | /usr/bin/wc -l`
|
9
|
if [ $ALLOWOVERRIDE -gt 0 ]; then
|
10
|
# write nameservers to file
|
11
|
if [ $6 = "dns1" ]; then
|
12
|
echo $7 > /var/etc/nameserver_$1
|
13
|
/sbin/route delete $7
|
14
|
/sbin/route add $7 $4
|
15
|
fi
|
16
|
|
17
|
if [ $8 = "dns2" ]; then
|
18
|
echo $9 >> /var/etc/nameserver_$1
|
19
|
/sbin/route delete $9
|
20
|
/sbin/route add $9 $4
|
21
|
fi
|
22
|
/usr/local/sbin/pfSctl -c 'service reload dns'
|
23
|
/bin/sleep 1
|
24
|
fi
|
25
|
|
26
|
/usr/local/sbin/pfSctl -c "interface newip $1"
|
27
|
exit 0
|