From fdbefe3eea74a93a76d3d6d0d928bd90c3007c7d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 21 Apr 2016 14:07:39 +0100 Subject: [PATCH] hotspot setup during install --- src/freedombone | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/freedombone b/src/freedombone index c076afa5..ca34d581 100755 --- a/src/freedombone +++ b/src/freedombone @@ -444,6 +444,7 @@ WIFI_INTERFACE=wlan0 WIFI_TYPE='wpa2-psk' WIFI_SSID= WIFI_PASSPHRASE= +WIFI_HOTSPOT='no' # cjdns settings ENABLE_CJDNS="no" @@ -1075,6 +1076,9 @@ function read_configuration { if grep -q "WIFI_PASSPHRASE" $CONFIGURATION_FILE; then WIFI_PASSPHRASE=$(grep "WIFI_PASSPHRASE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi + if grep -q "WIFI_HOTSPOT" $CONFIGURATION_FILE; then + WIFI_HOTSPOT=$(grep "WIFI_HOTSPOT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') + fi if grep -q "SYNCTHING_ID" $CONFIGURATION_FILE; then SYNCTHING_ID=$(grep "SYNCTHING_ID" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi @@ -1725,6 +1729,12 @@ function setup_wifi { if grep -Fxq "setup_wifi" $COMPLETION_FILE; then return fi + + HOTSPOT='no' + if [[ $WIFI_HOTSPOT != 'no' ]]; then + HOTSPOT='yes' + fi + if [[ $WIFI_TYPE != 'none' ]]; then if [ ! $WIFI_PASSPHRASE ]; then echo $'No wifi passphrase was given' @@ -1734,9 +1744,9 @@ function setup_wifi { echo $'Wifi passphrase was too short' return fi - ${PROJECT_NAME}-wifi -i $WIFI_INTERFACE -s $WIFI_SSID -t $WIFI_TYPE -p $WIFI_PASSPHRASE + ${PROJECT_NAME}-wifi -i $WIFI_INTERFACE -s $WIFI_SSID -t $WIFI_TYPE -p $WIFI_PASSPHRASE --hotspot $HOTSPOT else - ${PROJECT_NAME}-wifi -i $WIFI_INTERFACE -s $WIFI_SSID -t $WIFI_TYPE + ${PROJECT_NAME}-wifi -i $WIFI_INTERFACE -s $WIFI_SSID -t $WIFI_TYPE --hotspot $HOTSPOT fi echo 'setup_wifi' >> $COMPLETION_FILE }