diff --git a/src/freedombone-app-scuttlebot b/src/freedombone-app-scuttlebot index db0c975b32b40ca7db2c231fcfbdb43c32146519..757d2920e425fbe3d256a59f9c4f553f6eb12de7 100755 --- a/src/freedombone-app-scuttlebot +++ b/src/freedombone-app-scuttlebot @@ -254,7 +254,7 @@ EOF echo 'User=scuttlebot'; echo 'Group=scuttlebot'; echo "WorkingDirectory=/etc/scuttlebot"; - echo 'ExecStart=/etc/scuttlebot/node_modules/.bin/sbot server'; + echo 'ExecStart=/etc/scuttlebot/node_modules/scuttlebot/bin.js server'; echo 'Restart=always'; echo 'Environment="USER=scuttlebot"'; echo ''; @@ -306,7 +306,7 @@ EOF echo 'User=scuttlebot'; echo 'Group=scuttlebot'; echo "WorkingDirectory=/etc/scuttlebot"; - echo 'ExecStart=/etc/scuttlebot/node_modules/.bin/sbot server'; + echo 'ExecStart=/etc/scuttlebot/node_modules/scuttlebot/bin.js server'; echo 'Restart=always'; echo 'Environment="USER=scuttlebot"'; echo ''; @@ -357,6 +357,21 @@ EOF firewall_add scuttlebot ${SCUTTLEBOT_PORT} + # wait for keys to be generated + ctr=0 + until [ $ctr -lt 6 ]; do + if [ -f /etc/scuttlebot/.ssb/manifest.json ]; then + break + fi + ctr=$((ctr+1)) + sleep 3 + done + + if [ ! -f /etc/scuttlebot/.ssb/manifest.json ]; then + echo $'scuttlebot manifest was not generated' + exit 3658735 + fi + scuttlebot_create_single_invite if ! grep -q "scuttlebot version:" "${COMPLETION_FILE}"; then