From dad968c2d274faf85bd578ded80cc8c0151d7b43 Mon Sep 17 00:00:00 2001 From: Alexander Safonov Date: Wed, 4 Mar 2020 15:48:47 +0300 Subject: [PATCH] Add WEP support from config file To add support of WEP authorization, generated hostapd.conf should contain these lines: auth_algs=1 wep_default_key=0 wep_key0=${WEP_KEY} Where WEP_KEY is a key used for WEP authorization, a parameter that can be set within create_ap config file. --- create_ap | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/create_ap b/create_ap index 4f06255..8cd3dae 100755 --- a/create_ap +++ b/create_ap @@ -645,6 +645,7 @@ DAEMON_PIDFILE= DAEMON_LOGFILE=/dev/null NO_HAVEGED=0 USE_PSK=0 +WEP_KEY= HOSTAPD_DEBUG_ARGS= REDIRECT_TO_LOCALHOST=0 @@ -652,7 +653,7 @@ REDIRECT_TO_LOCALHOST=0 CONFIG_OPTS=(CHANNEL GATEWAY WPA_VERSION ETC_HOSTS DHCP_DNS NO_DNS NO_DNSMASQ HIDDEN MAC_FILTER MAC_FILTER_ACCEPT ISOLATE_CLIENTS SHARE_METHOD IEEE80211N IEEE80211AC HT_CAPAB VHT_CAPAB DRIVER NO_VIRT COUNTRY FREQ_BAND NEW_MACADDR DAEMONIZE DAEMON_PIDFILE DAEMON_LOGFILE NO_HAVEGED WIFI_IFACE INTERNET_IFACE - SSID PASSPHRASE USE_PSK) + SSID PASSPHRASE USE_PSK WEP_KEY) FIX_UNMANAGED=0 LIST_RUNNING=0 @@ -1697,6 +1698,14 @@ rsn_pairwise=CCMP EOF fi +if [[ -n "$WEP_KEY" ]]; then + cat << EOF >> $CONFDIR/hostapd.conf +auth_algs=1 +wep_default_key=0 +wep_key0=${WEP_KEY} +EOF +fi + if [[ "$SHARE_METHOD" == "bridge" ]]; then echo "bridge=${BRIDGE_IFACE}" >> $CONFDIR/hostapd.conf elif [[ $NO_DNSMASQ -eq 0 ]]; then