Skip to content

Commit 745892d

Browse files
committed
Add slack webhook
Sometimes the web log display is SLOW and never updates.
1 parent b908872 commit 745892d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

script.sh

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ echo To connect to this session copy-n-paste the following into a terminal:
2626
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
2727
echo After connecting you can run 'touch /tmp/keepalive' to disable the 15m timeout
2828

29+
if [[ ! -z "$SLACK_WEBHOOK_URL" ]]; then
30+
MSG=$(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}')
31+
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$MSG\"}" $SLACK_WEBHOOK_URL
32+
fi
33+
2934
# Wait for connection to close or timeout in 15 min
3035
timeout=$((15*60))
3136
while [ -S /tmp/tmate.sock ]; do

0 commit comments

Comments
 (0)