Skip to content

Commit

Permalink
Add keepalive option
Browse files Browse the repository at this point in the history
  • Loading branch information
csexton committed Oct 2, 2019
1 parent 5bfdaae commit 5129d1d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ 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}'

echo "echo hi from debugger" >> ~/.bash_profile

# Wait for connection to close or timeout in 15 min
timeout=$((15*60))
timeout=$((2*60))
while [ -S /tmp/tmate.sock ]; do
sleep 1
timeout=$(($timeout-1))
if (( timeout < 0 )); then
echo Waiting on tmate connection timed out!
exit 1

if [ ! -f /tmp/keepalive ] ; then
if (( timeout < 0 )); then
echo Waiting on tmate connection timed out!
exit 1
fi
fi
done

0 comments on commit 5129d1d

Please sign in to comment.