Browse Source

More wifi parameters

Bob Mottram 10 years ago
parent
commit
c738c1d87e
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      install-freedombone.sh

+ 10
- 2
install-freedombone.sh View File

317
 
317
 
318
 # wifi interface
318
 # wifi interface
319
 WIFI_INTERFACE="wlan0"
319
 WIFI_INTERFACE="wlan0"
320
+WIFI_HOTSPOT_MODE="g"
321
+WIFI_HOTSPOT_CHANNEL=7
320
 
322
 
321
 # message if something fails to install
323
 # message if something fails to install
322
 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."
324
 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
       if grep -q "WIFI_INTERFACE" $CONFIGURATION_FILE; then
405
       if grep -q "WIFI_INTERFACE" $CONFIGURATION_FILE; then
404
           WIFI_INTERFACE=$(grep "WIFI_INTERFACE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
406
           WIFI_INTERFACE=$(grep "WIFI_INTERFACE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
405
       fi
407
       fi
408
+      if grep -q "WIFI_HOTSPOT_MODE" $CONFIGURATION_FILE; then
409
+          WIFI_HOTSPOT_MODE=$(grep "WIFI_HOTSPOT_MODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
410
+      fi
411
+      if grep -q "WIFI_HOTSPOT_CHANNEL" $CONFIGURATION_FILE; then
412
+          WIFI_HOTSPOT_CHANNEL=$(grep "WIFI_HOTSPOT_CHANNEL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
413
+      fi
406
       if grep -q "ENABLE_WIFI" $CONFIGURATION_FILE; then
414
       if grep -q "ENABLE_WIFI" $CONFIGURATION_FILE; then
407
           ENABLE_WIFI=$(grep "ENABLE_WIFI" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
415
           ENABLE_WIFI=$(grep "ENABLE_WIFI" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
408
       fi
416
       fi
7111
   echo '' >> /etc/hostapd/hostapd.conf
7119
   echo '' >> /etc/hostapd/hostapd.conf
7112
   echo "ssid=$WIFI_ESSID" >> /etc/hostapd/hostapd.conf
7120
   echo "ssid=$WIFI_ESSID" >> /etc/hostapd/hostapd.conf
7113
   echo '' >> /etc/hostapd/hostapd.conf
7121
   echo '' >> /etc/hostapd/hostapd.conf
7114
-  echo 'channel=3' >> /etc/hostapd/hostapd.conf
7122
+  echo "channel=${WIFI_HOTSPOT_CHANNEL}" >> /etc/hostapd/hostapd.conf
7115
   echo '' >> /etc/hostapd/hostapd.conf
7123
   echo '' >> /etc/hostapd/hostapd.conf
7116
-  echo 'hw_mode=n' >> /etc/hostapd/hostapd.conf
7124
+  echo "hw_mode=$WIFI_HOTSPOT_MODE" >> /etc/hostapd/hostapd.conf
7117
   echo '' >> /etc/hostapd/hostapd.conf
7125
   echo '' >> /etc/hostapd/hostapd.conf
7118
   echo '# # Static WPA2 key configuration' >> /etc/hostapd/hostapd.conf
7126
   echo '# # Static WPA2 key configuration' >> /etc/hostapd/hostapd.conf
7119
   echo '# #1=wpa1, 2=wpa2, 3=both' >> /etc/hostapd/hostapd.conf
7127
   echo '# #1=wpa1, 2=wpa2, 3=both' >> /etc/hostapd/hostapd.conf