Ver código fonte

Change scuttlebot hostname on network restart

Bob Mottram 7 anos atrás
pai
commit
0653eae160
2 arquivos alterados com 5 adições e 1 exclusões
  1. 2
    1
      src/freedombone-image-mesh
  2. 3
    0
      src/freedombone-mesh-batman

+ 2
- 1
src/freedombone-image-mesh Ver arquivo

@@ -1302,7 +1302,7 @@ function initialise_scuttlebot_pub {
1302 1302
     fi
1303 1303
 
1304 1304
     echo '{' > /etc/scuttlebot/.ssb/config
1305
-    echo "  \"host\": \"${HOSTNAME}\"," >> /etc/scuttlebot/.ssb/config
1305
+    echo "  \"host\": \"$P{PEER_ID}.local\"," >> /etc/scuttlebot/.ssb/config
1306 1306
     echo "  \"port\": ${SCUTTLEBOT_PORT}," >> /etc/scuttlebot/.ssb/config
1307 1307
     echo '  "allowPrivate": true,' >> /etc/scuttlebot/.ssb/config
1308 1308
     echo '  "timeout": 30000,' >> /etc/scuttlebot/.ssb/config
@@ -1330,6 +1330,7 @@ function initialise_scuttlebot_pub {
1330 1330
         ln -s /etc/nginx/sites-available/git_ssb /etc/nginx/sites-enabled/git_ssb
1331 1331
         systemctl enable git_ssb.service
1332 1332
         systemctl start git_ssb.service
1333
+
1333 1334
     fi
1334 1335
 }
1335 1336
 

+ 3
- 0
src/freedombone-mesh-batman Ver arquivo

@@ -507,6 +507,9 @@ function start {
507 507
         systemctl disable tor
508 508
     fi
509 509
 
510
+    sed -i "s|\"host\":.*|\"host\": \"${HOSTNAME}.local\",|g" /etc/scuttlebot/.ssb/config
511
+    systemctl restart scuttlebot
512
+
510 513
     verify
511 514
 }
512 515