Skip to content

Commit d1b2d8c

Browse files
committed
grab discord bot token on server start
1 parent 0eadc30 commit d1b2d8c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/eco-server-start.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/usr/bin/bash
22

33
eco_server_api_token=$(aws ssm get-parameter --name /eco/server-api-token --with-decryption --query Parameter.Value --output text)
4+
discord_bot_token=$(aws ssm get-parameter --name /eco/discord-bot-token --with-decryption --query Parameter.Value --output text)
5+
6+
# Inject Discord bot token into DiscordLink.eco config
7+
config_path="/home/kai/Steam/steamapps/common/EcoServer/Configs/DiscordLink.eco"
8+
if [ -f "$config_path" ]; then
9+
tmp=$(mktemp)
10+
jq --arg token "$discord_bot_token" '.BotToken = $token' "$config_path" > "$tmp" && mv "$tmp" "$config_path"
11+
fi
412

513
chmod a+x "/home/kai/Steam/steamapps/common/EcoServer/EcoServer"
614
"/home/kai/Steam/steamapps/common/EcoServer/EcoServer" -userToken="$eco_server_api_token"

0 commit comments

Comments
 (0)