Changeset 10608 in hybrid
- Timestamp:
- Apr 29, 2012, 12:02:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/releng-9.0/nanobsd/files/etc/dhclient-exit-hooks
r10598 r10608 21 21 22 22 update_pf_conf() { 23 if is_default_interface; then 24 new_ext_if_gw=`route -n get default | awk '/gateway/ {print $2}'` 25 if [ -n "$new_ext_if_gw" ]; then 26 if [ -a "$new_ext_if_gw" != "$ext_if_gw" ]; then 27 info "Reloading PF firewall to load new ext_if_gw=$ext_if_gw" 28 { grep -v '^ext_if_gw=' $rc_conf_running; echo "ext_if_gw=$new_ext_if_gw"; } > $rc_conf_running 29 /etc/rc.d/pf reload 30 fi 23 $LOGGER "reason: $reason" 24 if is_default_interface 2>/dev/null; then 25 $LOGGER "is_default_interface: TRUE" 26 new_ext_if_gw=`route -n get default 2>/dev/null | awk '/gateway/ {print $2}'` 27 $LOGGER "prev default gateway: $ext_if_gw" 28 $LOGGER "curr default gateway: $new_ext_if_gw" 29 if [ -n "$new_ext_if_gw" -a "$new_ext_if_gw" != "$ext_if_gw" ]; then 30 $LOGGER "Reloading PF firewall to load new ext_if_gw=$new_ext_if_gw" 31 { grep -v '^ext_if_gw=' $rc_conf_running; echo "ext_if_gw=$new_ext_if_gw"; } > $rc_conf_running 32 $LOGGER "`/etc/rc.d/pf reload 2>&1`" 31 33 fi 34 else 35 $LOGGER "is_default_interface: FALSE" 32 36 fi 33 37 … … 36 40 checkyesno "service_proxy_ileiden" && return 37 41 38 if checkyesno "service_proxy_normal" && checkyesno "service_accesspoint"; then39 warn"Removing default route as machine is marked as service_proxy AND service_accesspoint"40 route -q del default42 if [ -n "$new_ext_if_gw" ] && checkyesno "service_proxy_normal" && checkyesno "service_accesspoint"; then 43 $LOGGER "Removing default route as machine is marked as service_proxy AND service_accesspoint" 44 $LOGGER "`route -q del default 2>&1`" 41 45 fi 42 46 } 43 47 44 reason=${reason:-$FORCE} 45 48 reason=${reason:-${REASON:-"BOUND"}} 46 49 case $reason in 47 50 BOUND|RENEW|REBIND|REBOOT) 48 update_pf_conf 51 update_pf_conf 49 52 ;; 50 53 TIMEOUT)
Note:
See TracChangeset
for help on using the changeset viewer.