diff options
author | Ermal <eri@pfsense.org> | 2010-09-15 19:24:26 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-09-15 19:24:26 +0000 |
commit | 0c452870cdc2816749f4b1c12370a3d6a64158d5 (patch) | |
tree | 9df6331b1fced52992109f19aa226a5aa4d499cf | |
parent | d8bf779be2910026e44ca9f493c02df960b94408 (diff) | |
download | pfsense-0c452870cdc2816749f4b1c12370a3d6a64158d5.zip pfsense-0c452870cdc2816749f4b1c12370a3d6a64158d5.tar.gz |
Reload dns and interface properly on dynamic types.
-rwxr-xr-x | sbin/dhclient-script | 18 | ||||
-rwxr-xr-x | usr/local/sbin/ovpn-linkup | 2 | ||||
-rwxr-xr-x | usr/local/sbin/ppp-linkdown | 1 | ||||
-rwxr-xr-x | usr/local/sbin/ppp-linkup | 4 |
4 files changed, 14 insertions, 11 deletions
diff --git a/sbin/dhclient-script b/sbin/dhclient-script index 7f1862e..87f8d20 100755 --- a/sbin/dhclient-script +++ b/sbin/dhclient-script @@ -59,6 +59,7 @@ arp_flush() { } delete_old_address() { + rm -f /var/db/${interface}_ip $IFCONFIG $interface inet -alias $old_ip_address $medium } @@ -80,8 +81,8 @@ add_new_address() { $LOGGER "New Routers ($interface): $new_routers" echo $new_routers > /tmp/${interface}_router - cp /var/db/${interface}_ip /tmp/rc.newwanip_oldip 2>/dev/null - /usr/local/sbin/pfSctl -c "'interface reload $interface'" + echo $new_ip_address > /var/db/${interface}_ip + /usr/local/sbin/pfSctl -c "interface reload $interface" } @@ -163,15 +164,13 @@ add_new_routes() { add_new_resolv_conf() { $LOGGER "Creating resolv.conf" - if [ ! -f "/var/etc/nameserver_$interface" ]; then - # Make sure file exists to avoid errors - touch /var/etc/nameserver_$interface - fi - if [ -n "$new_domain_name_servers" ]; then + if [ -f "/var/etc/nameserver_$interface" ]; then # Remove old entries for nameserver in `cat /var/etc/nameserver_$interface`; do $ROUTE delete $nameserver done + fi + if [ -n "$new_domain_name_server" ]; then rm -f /var/etc/nameserver_$interface for nameserver in $new_domain_name_servers; do # Add a route to the nameserver out the correct interface @@ -180,10 +179,11 @@ add_new_resolv_conf() { echo $nameserver >>/var/etc/nameserver_$interface $ROUTE add $nameserver -iface $interface done - echo $new_domain_name >/var/etc/defaultdomain.conf + #echo $new_domain_name >/var/etc/defaultdomain.conf + /usr/local/sbin/pfSctl -c 'service reload dns' fi - /usr/local/sbin/pfSctl -c "'interface reload $interface'" + /usr/local/sbin/pfSctl -c "interface reload $interface" return 0 } diff --git a/usr/local/sbin/ovpn-linkup b/usr/local/sbin/ovpn-linkup index 354623e..cc09003 100755 --- a/usr/local/sbin/ovpn-linkup +++ b/usr/local/sbin/ovpn-linkup @@ -3,7 +3,7 @@ # write nameservers to file needs dns fidnings?! # let the configuration system know that the ip has changed. -#/usr/local/sbin/pfSctl -c "'interface reload $interface'" +#/usr/local/sbin/pfSctl -c "interface reload $interface" /bin/echo $4 > /tmp/$1_router /usr/bin/touch /tmp/$1up # reload filter diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown index 8b09846..55be9d6 100755 --- a/usr/local/sbin/ppp-linkdown +++ b/usr/local/sbin/ppp-linkdown @@ -10,4 +10,5 @@ fi # Do not remove gateway used during filter reload. /bin/rm -f /tmp/$1_router /bin/rm -f /tmp/$1up +/bin/rm -f /tmp/$1_ip /usr/local/sbin/pfSctl -c 'service reload dns' diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup index f1d7018..e0b44af 100755 --- a/usr/local/sbin/ppp-linkup +++ b/usr/local/sbin/ppp-linkup @@ -15,6 +15,8 @@ fi # let the configuration system know that the ip has changed. /bin/echo $4 > /tmp/$1_router +/bin/echo $3 > /tmp/$1_ip /usr/bin/touch /tmp/$1up -/usr/local/sbin/pfSctl -c "'interface reload $1'" +/usr/local/sbin/pfSctl -c 'service reload dns' +/usr/local/sbin/pfSctl -c "interface reload $1" exit 0 |