Skip to content

Commit

Permalink
Add timeout
Browse files Browse the repository at this point in the history
Don't want this action running forever if it is being ignored. Might be
nice to add a way to prevent the timeout from occurring if the user is
currently logged in.
  • Loading branch information
csexton committed Oct 2, 2019
1 parent 7d5cde8 commit ee50858
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ tmate -S /tmp/tmate.sock wait tmate-ready
echo To connect to this session copy-n-paste the following into a terminal:
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'

# Wait for connection to close
# Wait for connection to close or timeout in 15 min
timeout=$((15*60))
while [ -S /tmp/tmate.sock ]; do
sleep 1
timeout=$(($timeout-1))
[ $timeout -gt 0 ] || exit 1
done

0 comments on commit ee50858

Please sign in to comment.