Skip to content
Snippets Groups Projects
Commit 8f6d21ad authored by Bob Mottram's avatar Bob Mottram
Browse files

Creating scuttlebot invites

parent 1226dfde
No related branches found
No related tags found
No related merge requests found
......@@ -54,11 +54,19 @@ function logging_off_scuttlebot {
echo -n ''
}
function scuttlebot_create_invite {
function scuttlebot_create_single_invite {
invite_string=$(su -c "/etc/scuttlebot/node_modules/.bin/sbot invite.create 1" - scuttlebot | sed 's/"//g')
if [ ! "$invite_string" ]; then
echo $'Unable to create scuttlebot invite'
exit 36583568
fi
write_config_param SCUTTLEBOT_INVITE "$invite_string"
}
function scuttlebot_create_invite {
scuttlebot_create_single_invite
clear
echo -e "\\n\\nYour Scuttlebot invite code is:\\n\\n${invite_string}\\n\\n"
echo -e "\\n\\nYour Scuttlebot invite code is:\\n\\n${SCUTTLEBOT_INVITE}\\n\\n"
# shellcheck disable=SC2034
read -n1 -r -p $"Press any key to continue..." key
}
......@@ -360,6 +368,8 @@ EOF
firewall_add scuttlebot ${SCUTTLEBOT_PORT}
scuttlebot_create_single_invite
if ! grep -q "scuttlebot version:" "${COMPLETION_FILE}"; then
echo "scuttlebot version:${SCUTTLEBOT_VERSION}" >> "${COMPLETION_FILE}"
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment