diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2010-02-28 15:08:47 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2010-02-28 15:08:47 +0100 |
commit | fee0d9dbd7d00e273a90120bd06a381ab1fad9bb (patch) | |
tree | 4d2ca4f3e5d6c236c52853b521c3032f9b1d141a /package/base-files/src/etc/network | |
parent | 5dab5a73f1c0c545a121c9badd8e6d95a468fff0 (diff) | |
parent | a21751d05ee06fd4e0bfae705e8467922b344120 (diff) |
Merge branch 'master' of git+ssh://wbx@openadk.org/git/openadk
Diffstat (limited to 'package/base-files/src/etc/network')
-rwxr-xr-x | package/base-files/src/etc/network/if-pre-up.d/04-wireless | 11 | ||||
-rwxr-xr-x | package/base-files/src/etc/network/if-up.d/02-wireless | 15 |
2 files changed, 19 insertions, 7 deletions
diff --git a/package/base-files/src/etc/network/if-pre-up.d/04-wireless b/package/base-files/src/etc/network/if-pre-up.d/04-wireless index bc498e163..1898de4d4 100755 --- a/package/base-files/src/etc/network/if-pre-up.d/04-wireless +++ b/package/base-files/src/etc/network/if-pre-up.d/04-wireless @@ -38,10 +38,6 @@ esac case "$IF_WIRELESS_MODE" in ap) - [ -x /usr/sbin/hostapd ] || { - logger -t hostap "No hostapd program found" - exit 1 - } logger -t hostap "Creating hostapd configuration" cat /etc/hostapd.conf > /tmp/hostapd.conf chmod 600 /tmp/hostapd.conf @@ -50,6 +46,10 @@ case "$IF_WIRELESS_MODE" in echo "channel=$IF_WIRELESS_CHANNEL" >> /tmp/hostapd.conf echo "hw_mode=$IF_WIRELESS_HWMODE" >> /tmp/hostapd.conf echo "auth_algs=$sec" >> /tmp/hostapd.conf + [ $wpa -eq 0 ] && { + logger -t hostap "using no security mechanism" + echo "wpa=0" >> /tmp/hostapd.conf + } [ $wpa1 -eq 1 ] && { logger -t hostap "using WPA for security" echo "wpa=1" >> /tmp/hostapd.conf @@ -72,8 +72,6 @@ case "$IF_WIRELESS_MODE" in echo "rsn_pairwise=CCMP" >> /tmp/hostapd.conf echo "wpa_passphrase=$IF_WIRELESS_PASSPHRASE" >> /tmp/hostapd.conf } - logger -t hostap "Starting hostapd" - hostapd -B /tmp/hostapd.conf ;; sta) [ -x /usr/sbin/iw ] || { @@ -103,5 +101,4 @@ case "$IF_WIRELESS_MODE" in exit 1 ;; esac - exit 0 diff --git a/package/base-files/src/etc/network/if-up.d/02-wireless b/package/base-files/src/etc/network/if-up.d/02-wireless new file mode 100755 index 000000000..cd9d2af3f --- /dev/null +++ b/package/base-files/src/etc/network/if-up.d/02-wireless @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +[ "${IFACE%%[0-9]*}" = "wlan" ] || exit 0 + +case "$IF_WIRELESS_MODE" in + ap) + [ -x /usr/sbin/hostapd ] || { + logger -t hostap "No hostapd program found" + exit 1 + } + logger -t hostap "Starting hostapd" + hostapd -B /tmp/hostapd.conf + ;; +esac |