This commit is contained in:
1 parent
31c55525c3
commit
59ab154d0f
1 file changed
+5
-4
+5
-4
@@ -68,10 +68,11 @@ cd "$TARGET_DIR"
|
||||
|
||||
# Capture the bot key from Docker before recreating the bot; runner mounts may not include the host env file.
|
||||
if docker inspect canina-bot >/dev/null 2>&1; then
|
||||
LIVE_BOT_KEY=
|
||||
if [ -n "" ]; then
|
||||
grep -v ^SUPPORT_CHAT_KEY= .support-chat.env > .support-chat.env.tmp 2>/dev/null || true
|
||||
printf "SUPPORT_CHAT_KEY=%s\n" "" >> .support-chat.env.tmp
|
||||
LIVE_BOT_KEY=$(docker inspect -f '{{range .Config.Env}}{{println .}}{{end}}' canina-bot | awk -F= '$1 == "SUPPORT_INTERNAL_KEY" {print substr($0, index($0, "=") + 1); exit}')
|
||||
if [ -n "$LIVE_BOT_KEY" ]; then
|
||||
grep -v '^SUPPORT_CHAT_KEY=' .support-chat.env > .support-chat.env.tmp 2>/dev/null || true
|
||||
printf 'SUPPORT_CHAT_KEY=%s
|
||||
' "$LIVE_BOT_KEY" >> .support-chat.env.tmp
|
||||
mv .support-chat.env.tmp .support-chat.env
|
||||
chmod 600 .support-chat.env
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user