瀏覽代碼

Change scuttlebot hostname on network restart

Bob Mottram 7 年之前
父節點
當前提交
0653eae160
共有 2 個檔案被更改,包括 5 行新增1 行删除
  1. 2
    1
      src/freedombone-image-mesh
  2. 3
    0
      src/freedombone-mesh-batman

+ 2
- 1
src/freedombone-image-mesh 查看文件

1302
     fi
1302
     fi
1303
 
1303
 
1304
     echo '{' > /etc/scuttlebot/.ssb/config
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
     echo "  \"port\": ${SCUTTLEBOT_PORT}," >> /etc/scuttlebot/.ssb/config
1306
     echo "  \"port\": ${SCUTTLEBOT_PORT}," >> /etc/scuttlebot/.ssb/config
1307
     echo '  "allowPrivate": true,' >> /etc/scuttlebot/.ssb/config
1307
     echo '  "allowPrivate": true,' >> /etc/scuttlebot/.ssb/config
1308
     echo '  "timeout": 30000,' >> /etc/scuttlebot/.ssb/config
1308
     echo '  "timeout": 30000,' >> /etc/scuttlebot/.ssb/config
1330
         ln -s /etc/nginx/sites-available/git_ssb /etc/nginx/sites-enabled/git_ssb
1330
         ln -s /etc/nginx/sites-available/git_ssb /etc/nginx/sites-enabled/git_ssb
1331
         systemctl enable git_ssb.service
1331
         systemctl enable git_ssb.service
1332
         systemctl start git_ssb.service
1332
         systemctl start git_ssb.service
1333
+
1333
     fi
1334
     fi
1334
 }
1335
 }
1335
 
1336
 

+ 3
- 0
src/freedombone-mesh-batman 查看文件

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