Skip to content

Commit 5129d1d

Browse files
committed
Add keepalive option
1 parent 5bfdaae commit 5129d1d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

script.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ tmate -S /tmp/tmate.sock wait tmate-ready
2323
echo To connect to this session copy-n-paste the following into a terminal:
2424
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
2525

26-
echo "echo hi from debugger" >> ~/.bash_profile
27-
2826
# Wait for connection to close or timeout in 15 min
29-
timeout=$((15*60))
27+
timeout=$((2*60))
3028
while [ -S /tmp/tmate.sock ]; do
3129
sleep 1
3230
timeout=$(($timeout-1))
33-
if (( timeout < 0 )); then
34-
echo Waiting on tmate connection timed out!
35-
exit 1
31+
32+
if [ ! -f /tmp/keepalive ] ; then
33+
if (( timeout < 0 )); then
34+
echo Waiting on tmate connection timed out!
35+
exit 1
36+
fi
3637
fi
3738
done

0 commit comments

Comments
 (0)