Browse Source

original interfaces file

Bob Mottram 9 years ago
parent
commit
1189d07005
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      src/freedombone-wifi

+ 7
- 5
src/freedombone-wifi View File

58
 
58
 
59
     rm /etc/hostapd/hostapd.conf
59
     rm /etc/hostapd/hostapd.conf
60
 
60
 
61
-    if [ -f /etc/network/interfaces_old ]; then
62
-        cp /etc/network/interfaces_old /etc/network/interfaces
61
+    if [ -f /etc/network/interfaces_original ]; then
62
+        cp /etc/network/interfaces_original /etc/network/interfaces
63
     else
63
     else
64
         echo '# interfaces(5) file used by ifup(8) and ifdown(8)' > /etc/network/interfaces
64
         echo '# interfaces(5) file used by ifup(8) and ifdown(8)' > /etc/network/interfaces
65
         echo '# Include files from /etc/network/interfaces.d:' >> /etc/network/interfaces
65
         echo '# Include files from /etc/network/interfaces.d:' >> /etc/network/interfaces
110
     echo '## Accept all MAC address ###' >> /etc/hostapd/hostapd.conf
110
     echo '## Accept all MAC address ###' >> /etc/hostapd/hostapd.conf
111
     echo 'macaddr_acl=0' >> /etc/hostapd/hostapd.conf
111
     echo 'macaddr_acl=0' >> /etc/hostapd/hostapd.conf
112
 
112
 
113
-    if ! grep -q "# Hotspot" /etc/network/interfaces; then
114
-        cp /etc/network/interfaces /etc/network/interfaces_old
115
-    fi
113
+    if [ ! -f /etc/network/interfaces_original ]; then
114
+        if ! grep -q "# Hotspot" /etc/network/interfaces; then
115
+            cp /etc/network/interfaces /etc/network/interfaces_original
116
+        fi
117
+    fi  
116
     
118
     
117
     echo '# Hotspot' > /etc/network/interfaces
119
     echo '# Hotspot' > /etc/network/interfaces
118
     echo 'auto lo br0' >> /etc/network/interfaces
120
     echo 'auto lo br0' >> /etc/network/interfaces