Browse Source

hostapd start and stop

Bob Mottram 8 years ago
parent
commit
22f5ececf8
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/freedombone-mesh-batman

+ 4
- 2
src/freedombone-mesh-batman View File

145
         ifconfig $EIFACE down -promisc
145
         ifconfig $EIFACE down -promisc
146
     fi
146
     fi
147
     if [ $IFACE_SECONDARY ]; then
147
     if [ $IFACE_SECONDARY ]; then
148
+        systemctl stop hostapd
148
         brctl delif $BRIDGE_HOTSPOT bat0
149
         brctl delif $BRIDGE_HOTSPOT bat0
149
         ifconfig $BRIDGE_HOTSPOT down || true
150
         ifconfig $BRIDGE_HOTSPOT down || true
150
         brctl delbr $BRIDGE_HOTSPOT
151
         brctl delbr $BRIDGE_HOTSPOT
287
 
288
 
288
                 sed -i 's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g' /etc/default/hostapd
289
                 sed -i 's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g' /etc/default/hostapd
289
 
290
 
290
-                echo "interface=$IFACE_SECONDARY" > /etc/hostapd/hostapd.conf
291
+                echo "interface=${IFACE_SECONDARY}" > /etc/hostapd/hostapd.conf
291
                 echo "bridge=${BRIDGE_HOTSPOT}" >> /etc/hostapd/hostapd.conf
292
                 echo "bridge=${BRIDGE_HOTSPOT}" >> /etc/hostapd/hostapd.conf
292
                 echo 'driver=nl80211' >> /etc/hostapd/hostapd.conf
293
                 echo 'driver=nl80211' >> /etc/hostapd/hostapd.conf
293
                 echo "country_code=UK" >> /etc/hostapd/hostapd.conf
294
                 echo "country_code=UK" >> /etc/hostapd/hostapd.conf
305
                 ifconfig $BRIDGE_HOTSPOT up
306
                 ifconfig $BRIDGE_HOTSPOT up
306
                 avahi-autoipd --force-bind --daemonize --wait $BRIDGE_HOTSPOT
307
                 avahi-autoipd --force-bind --daemonize --wait $BRIDGE_HOTSPOT
307
                 ifconfig $IFACE_SECONDARY up promisc
308
                 ifconfig $IFACE_SECONDARY up promisc
308
-                ifconfig $IFACE_SECONDARY auto-dhcp start
309
+                #ifconfig $IFACE_SECONDARY auto-dhcp start
310
+                systemctl start hostapd
309
             fi
311
             fi
310
         fi
312
         fi
311
     fi
313
     fi