Procházet zdrojové kódy

Use IPv4 address for scuttlebot

Bob Mottram před 7 roky
rodič
revize
f09b6732ab
1 změnil soubory, kde provedl 3 přidání a 4 odebrání
  1. 3
    4
      src/freedombone-mesh-batman

+ 3
- 4
src/freedombone-mesh-batman Zobrazit soubor

96
     . /etc/default/batctl
96
     . /etc/default/batctl
97
 fi
97
 fi
98
 
98
 
99
-function get_ipv6_bat0 {
100
-    echo $(ip -o -f inet6 addr show dev "bat0" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
99
+function get_ipv4_wlan {
100
+    echo $(ip -o -f inet addr show dev "$IFACE" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
101
 }
101
 }
102
 
102
 
103
 function mesh_hotspot_ip_address {
103
 function mesh_hotspot_ip_address {
407
     systemctl restart avahi-daemon
407
     systemctl restart avahi-daemon
408
 
408
 
409
     if [ -f /etc/scuttlebot/.ssb/config ]; then
409
     if [ -f /etc/scuttlebot/.ssb/config ]; then
410
-        ipv6addr=$(get_ipv6_bat0)
411
-        sed -i "s|\"host\": .*|\"host\": \"${ipv6addr}\",|g" /etc/scuttlebot/.ssb/config
410
+        sed -i "s|\"host\": .*|\"host\": \"$(get_ipv4_wlan)\",|g" /etc/scuttlebot/.ssb/config
412
         systemctl restart scuttlebot
411
         systemctl restart scuttlebot
413
     fi
412
     fi
414
 
413