From 7535e8b9887341df81041bea23f6f9d4c02fe9d3 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@robotics.uk.to>
Date: Fri, 21 Oct 2016 19:42:33 +0100
Subject: [PATCH] Roaming dhcp

---
 src/freedombone-utils-wifi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/freedombone-utils-wifi b/src/freedombone-utils-wifi
index e85ae9f5b..799d0f845 100755
--- a/src/freedombone-utils-wifi
+++ b/src/freedombone-utils-wifi
@@ -301,6 +301,9 @@ function wifi_wpa2_psk {
     echo "allow-hotplug ${WIFI_INTERFACE}" >> /etc/network/interfaces
     echo "iface ${WIFI_INTERFACE} inet manual" >> /etc/network/interfaces
     echo "  wpa-roam $WIFI_CONFIG" >> /etc/network/interfaces
+    echo '' >> /etc/network/interfaces
+    echo '#this line must always be here' >> /etc/network/interfaces
+    echo 'iface default inet dhcp' >> /etc/network/interfaces
 
     wpa_passphrase "$ssid" "$passphrase" > $WIFI_CONFIG
 
@@ -327,6 +330,9 @@ function wifi_none {
     echo "allow-hotplug ${WIFI_INTERFACE}" >> /etc/network/interfaces
     echo "iface ${WIFI_INTERFACE} inet manual" >> /etc/network/interfaces
     echo "  wpa-roam $WIFI_CONFIG" >> /etc/network/interfaces
+    echo '' >> /etc/network/interfaces
+    echo '#this line must always be here' >> /etc/network/interfaces
+    echo 'iface default inet dhcp' >> /etc/network/interfaces
 
     echo 'update_config=1' > $WIFI_CONFIG
     echo 'eapol_version=1' >> $WIFI_CONFIG
@@ -369,6 +375,9 @@ function networks_from_file {
     echo "allow-hotplug ${WIFI_INTERFACE}" >> /etc/network/interfaces
     echo "iface ${WIFI_INTERFACE} inet manual" >> /etc/network/interfaces
     echo "  wpa-roam $WIFI_CONFIG" >> /etc/network/interfaces
+    echo '' >> /etc/network/interfaces
+    echo '#this line must always be here' >> /etc/network/interfaces
+    echo 'iface default inet dhcp' >> /etc/network/interfaces
 
     # remove wpa_supplicant.conf if it exists
     if [ -f $WIFI_CONFIG ]; then
-- 
GitLab