|
Last change
on this file since 10595 was 10595, checked in by rick, 14 years ago |
|
Duh... time to stop. When it _is_ it should stop.
|
-
Property svn:executable
set to
*
|
|
File size:
1.5 KB
|
| Line | |
|---|
| 1 | #!/bin/sh -
|
|---|
| 2 | #
|
|---|
| 3 | # An normal proxy should not have an defaultrouter configured, as all calls to
|
|---|
| 4 | # the outside world are handled via PF redirects.
|
|---|
| 5 | #
|
|---|
| 6 | # Rick van der Zwet <rick@wirelessleiden.nl>
|
|---|
| 7 |
|
|---|
| 8 | # Little hack to load the available functions in case we are running this as an
|
|---|
| 9 | # standalone script (for testing mostly).
|
|---|
| 10 | if [ -z "$exit_status" ]; then
|
|---|
| 11 | grep -v 'exit $exit_status' /sbin/dhclient-script | eval
|
|---|
| 12 | fi
|
|---|
| 13 |
|
|---|
| 14 | . /etc/rc.subr
|
|---|
| 15 |
|
|---|
| 16 | : ${service_proxy_normal="NO"}
|
|---|
| 17 | : ${service_proxy_ileiden="NO"}
|
|---|
| 18 | : ${service_accesspoint="NO"}
|
|---|
| 19 |
|
|---|
| 20 | load_rc_config 'ileiden'
|
|---|
| 21 |
|
|---|
| 22 | update_pf_conf() {
|
|---|
| 23 | # Make sure not to nuke the default route on an ileiden proxy,
|
|---|
| 24 | # as it will rendering it usefull
|
|---|
| 25 | checkyesno "service_proxy_ileiden" && return
|
|---|
| 26 |
|
|---|
| 27 | if checkyesno "service_proxy_normal" && checkyesno "service_accesspoint"; then
|
|---|
| 28 | if is_default_interface; then
|
|---|
| 29 | new_ext_if_gw=`route -n get default | awk '/gateway/ {print $2}'`
|
|---|
| 30 | if [ -n "$new_ext_if_gw" ]; then
|
|---|
| 31 | if [ -a "$new_ext_if_gw" != "$ext_if_gw" ]; then
|
|---|
| 32 | info "Reloading PF firewall to load new ext_if_gw=$ext_if_gw"
|
|---|
| 33 | { grep -v '^ext_if_gw=' $rc_conf_running; echo "ext_if_gw=$new_ext_if_gw"; } > $rc_conf_running
|
|---|
| 34 | /etc/rc.d/pf reload
|
|---|
| 35 | fi
|
|---|
| 36 |
|
|---|
| 37 | warn "Removing default route as machine is marked as service_proxy AND service_accesspoint"
|
|---|
| 38 | route -q del default
|
|---|
| 39 | fi
|
|---|
| 40 | fi
|
|---|
| 41 | fi
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | reason=${reason:-$FORCE}
|
|---|
| 45 |
|
|---|
| 46 | case $reason in
|
|---|
| 47 | BOUND|RENEW|REBIND|REBOOT)
|
|---|
| 48 | update_pf_conf
|
|---|
| 49 | ;;
|
|---|
| 50 | TIMEOUT)
|
|---|
| 51 | update_pf_conf
|
|---|
| 52 | ;;
|
|---|
| 53 | esac
|
|---|
| 54 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.