1 |
e1c8cdf5
|
Scott Ullrich
|
#!/bin/sh
|
2 |
|
|
|
3 |
1033de74
|
Ermal
|
rm -f /var/etc/nameserver_$1
|
4 |
e1c8cdf5
|
Scott Ullrich
|
|
5 |
|
|
# unset CGI environment variables so as not to confuse PHP
|
6 |
|
|
unset CONTENT_TYPE GATEWAY_INTERFACE REMOTE_USER REMOTE_ADDR AUTH_TYPE
|
7 |
|
|
unset HTTP_USER_AGENT CONTENT_LENGTH SCRIPT_FILENAME HTTP_HOST
|
8 |
|
|
unset SERVER_SOFTWARE HTTP_REFERER SERVER_PROTOCOL REQUEST_METHOD
|
9 |
|
|
unset SERVER_PORT SCRIPT_NAME SERVER_NAME
|
10 |
|
|
|
11 |
|
|
# write nameservers to file
|
12 |
1033de74
|
Ermal
|
if [ "$6" = "dns1" ]
|
13 |
|
|
echo $7 >> /var/etc/nameserver_$1
|
14 |
|
|
/sbin/route add $7 -if $1
|
15 |
e1c8cdf5
|
Scott Ullrich
|
fi
|
16 |
1033de74
|
Ermal
|
|
17 |
1f559885
|
Ermal
|
if [ "$8" = "dns2" ]
|
18 |
1033de74
|
Ermal
|
echo $9 >> /var/etc/nameserver_$1
|
19 |
|
|
/sbin/route add $9 -if $1
|
20 |
e1c8cdf5
|
Scott Ullrich
|
fi
|
21 |
|
|
|
22 |
28ec82f1
|
Ermal Luçi
|
# let the configuration system know that the ip has changed.
|
23 |
|
|
/bin/echo $1 > /tmp/rc.newwanip
|
24 |
b87364eb
|
Ermal Luçi
|
/bin/echo $4 > /tmp/$1_router
|
25 |
6849a176
|
Ermal Luçi
|
/usr/bin/touch /tmp/$1up
|