diff options
Diffstat (limited to 'sbin/dhclient-script')
-rwxr-xr-x | sbin/dhclient-script | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sbin/dhclient-script b/sbin/dhclient-script index 87f8d20..6ea4136 100755 --- a/sbin/dhclient-script +++ b/sbin/dhclient-script @@ -82,7 +82,7 @@ add_new_address() { echo $new_routers > /tmp/${interface}_router echo $new_ip_address > /var/db/${interface}_ip - /usr/local/sbin/pfSctl -c "interface reload $interface" + /usr/local/sbin/pfSctl -c "interface newip $interface" } @@ -103,15 +103,11 @@ add_new_alias() { delete_old_routes() { $LOGGER "Deleting old routes" - $ROUTE delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1 # Only allow the default route to be overridden if it's on our own interface - DEFAULTROUTE_IFACE=`/sbin/route get default | grep interface | awk '{print $2};'` - if [ -z "${DEFAULTROUTE_IFACE}" -o "{$interface}" = "${DEFAULTROUTE_IFACE}" ]; then + if [ -f "/tmp/${interface}_defaultgw" ]; then for router in $old_routers; do - if [ $if_defaultroute = x -o $if_defaultroute = $interface ]; then - $ROUTE delete default $route >/dev/null 2>&1 - /bin/rm -f /tmp/${interface}_router - fi + $ROUTE delete default $router >/dev/null 2>&1 + /bin/rm -f /tmp/${interface}_router done fi @@ -183,8 +179,6 @@ add_new_resolv_conf() { /usr/local/sbin/pfSctl -c 'service reload dns' fi - /usr/local/sbin/pfSctl -c "interface reload $interface" - return 0 } |