create_ap

create a nat-ed wifi ap
git clone git://git.2f30.org/create_ap.git
Log | Files | Refs | LICENSE

commit 796c420589073ba7645d4d9b3dd433aa9463861a
parent 9ecb40eb6dc710fdfb64ea985e988090eb56ffb6
Author: oblique <psyberbits@gmail.com>
Date:   Sun Feb 22 21:53:22 +0200

check if bridge-nf-call-iptables exists before we use it

Diffstat:
create_ap | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/create_ap b/create_ap @@ -857,7 +857,9 @@ if [[ ${#PASSPHRASE} -gt 0 && ${#PASSPHRASE} -lt 8 ]] || [[ ${#PASSPHRASE} -gt 6 fi if [[ "$SHARE_METHOD" == "bridge" ]]; then - OLD_BRIDGE_IPTABLES=$(cat /proc/sys/net/bridge/bridge-nf-call-iptables) + if [[ -e /proc/sys/net/bridge/bridge-nf-call-iptables ]]; then + OLD_BRIDGE_IPTABLES=$(cat /proc/sys/net/bridge/bridge-nf-call-iptables) + fi if is_bridge_interface $INTERNET_IFACE; then BRIDGE_IFACE=$INTERNET_IFACE @@ -1030,7 +1032,9 @@ if [[ "$SHARE_METHOD" != "none" ]]; then echo 1 > /proc/sys/net/ipv4/ip_forward || die elif [[ "$SHARE_METHOD" == "bridge" ]]; then # disable iptables rules for bridged interfaces - echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables || die + if [[ -e /proc/sys/net/bridge/bridge-nf-call-iptables ]]; then + echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables + fi # to initialize the bridge interface correctly we need to do the following: #