Skip to content

Commit

Permalink
Add slack webhook
Browse files Browse the repository at this point in the history
Sometimes the web log display is SLOW and never updates.
  • Loading branch information
csexton committed Oct 9, 2019
1 parent b908872 commit 745892d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ echo To connect to this session copy-n-paste the following into a terminal:
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
echo After connecting you can run 'touch /tmp/keepalive' to disable the 15m timeout

if [[ ! -z "$SLACK_WEBHOOK_URL" ]]; then
MSG=$(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}')
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$MSG\"}" $SLACK_WEBHOOK_URL
fi

# Wait for connection to close or timeout in 15 min
timeout=$((15*60))
while [ -S /tmp/tmate.sock ]; do
Expand Down

0 comments on commit 745892d

Please sign in to comment.