From c738c1d87efc6946f9efb105c8797e0757022fdb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 25 Dec 2014 10:24:14 +0000 Subject: [PATCH] More wifi parameters --- install-freedombone.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/install-freedombone.sh b/install-freedombone.sh index 043f9182..654b7595 100755 --- a/install-freedombone.sh +++ b/install-freedombone.sh @@ -317,6 +317,8 @@ WIFI_PASSWORD= # wifi interface WIFI_INTERFACE="wlan0" +WIFI_HOTSPOT_MODE="g" +WIFI_HOTSPOT_CHANNEL=7 # message if something fails to install CHECK_MESSAGE="Check your internet connection, /etc/network/interfaces and /etc/resolv.conf, then delete $COMPLETION_FILE, run 'rm -fR /var/lib/apt/lists/* && apt-get update --fix-missing' and run this script again. If hash sum mismatches persist then try setting $DEBIAN_REPO to a different mirror and also change /etc/apt/sources.list." @@ -403,6 +405,12 @@ function read_configuration { if grep -q "WIFI_INTERFACE" $CONFIGURATION_FILE; then WIFI_INTERFACE=$(grep "WIFI_INTERFACE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi + if grep -q "WIFI_HOTSPOT_MODE" $CONFIGURATION_FILE; then + WIFI_HOTSPOT_MODE=$(grep "WIFI_HOTSPOT_MODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi + if grep -q "WIFI_HOTSPOT_CHANNEL" $CONFIGURATION_FILE; then + WIFI_HOTSPOT_CHANNEL=$(grep "WIFI_HOTSPOT_CHANNEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi if grep -q "ENABLE_WIFI" $CONFIGURATION_FILE; then ENABLE_WIFI=$(grep "ENABLE_WIFI" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi @@ -7111,9 +7119,9 @@ function enable_wifi_hotspot { echo '' >> /etc/hostapd/hostapd.conf echo "ssid=$WIFI_ESSID" >> /etc/hostapd/hostapd.conf echo '' >> /etc/hostapd/hostapd.conf - echo 'channel=3' >> /etc/hostapd/hostapd.conf + echo "channel=${WIFI_HOTSPOT_CHANNEL}" >> /etc/hostapd/hostapd.conf echo '' >> /etc/hostapd/hostapd.conf - echo 'hw_mode=n' >> /etc/hostapd/hostapd.conf + echo "hw_mode=$WIFI_HOTSPOT_MODE" >> /etc/hostapd/hostapd.conf echo '' >> /etc/hostapd/hostapd.conf echo '# # Static WPA2 key configuration' >> /etc/hostapd/hostapd.conf echo '# #1=wpa1, 2=wpa2, 3=both' >> /etc/hostapd/hostapd.conf