Browse Source

Update bmx devices within daemons

Bob Mottram 7 years ago
parent
commit
8fd134ed2a
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      src/freedombone-mesh-batman

+ 11
- 1
src/freedombone-mesh-batman View File

@@ -198,10 +198,14 @@ function start {
198 198
 
199 199
     modprobe batman-adv
200 200
 
201
-    # avahi on ipv4
201
+    # avahi on ipv6
202 202
     sed -i 's|use-ipv4=.*|use-ipv4=no|g' /etc/avahi/avahi-daemon.conf
203 203
     sed -i 's|use-ipv6=.*|use-ipv6=yes|g' /etc/avahi/avahi-daemon.conf
204 204
 
205
+    sed -i "s|ExecStart=.*|ExecStart=/usr/sbin/bmx6 dev=${IFACE}|g" /etc/systemd/system/bmx6.service
206
+    sed -i "s|ExecStart=.*|ExecStart=/usr/sbin/bmx7 dev=${IFACE}|g" /etc/systemd/system/bmx7.service
207
+    systemctl daemon-reload
208
+
205 209
     add_wifi_interface $IFACE $WIFI_SSID ad-hoc $CHANNEL
206 210
 
207 211
     # NOTE: Don't connect the secondary wifi device. hostapd will handle that by itself
@@ -220,6 +224,10 @@ function start {
220 224
             ifconfig $EIFACE 0.0.0.0
221 225
             ifconfig $EIFACE up promisc
222 226
             echo $'End of ethernet bridge'
227
+
228
+            sed -i "s|ExecStart=.*|ExecStart=/usr/sbin/bmx6 dev=${IFACE} dev=${EIFACE}|g" /etc/systemd/system/bmx6.service
229
+            sed -i "s|ExecStart=.*|ExecStart=/usr/sbin/bmx7 dev=${IFACE} dev=${EIFACE}|g" /etc/systemd/system/bmx7.service
230
+            systemctl daemon-reload
223 231
         else
224 232
             echo $"$EIFACE is not connected"
225 233
         fi
@@ -243,8 +251,10 @@ function start {
243 251
     fi
244 252
 
245 253
     if grep -q "bmx6" $MESH_DEFAULT_PROTOCOL; then
254
+        systemctl enable bmx6
246 255
         systemctl restart bmx6
247 256
     else
257
+        systemctl enable bmx7
248 258
         systemctl restart bmx7
249 259
     fi
250 260