Created
March 6, 2015 20:21
-
-
Save nicwolff/0393602c5ff67ef0c15a to your computer and use it in GitHub Desktop.
Send VT100 "Report Device OK" every 60 seconds to keep SSH from timing out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Send VT100 "Report Device OK" every 60 seconds to keep SSH from timing out | |
| notidle() { printf "\033[0n"; sleep 60; notidle; } | |
| PARENT_CMD=$(/bin/ps -ocommand= -p $PPID) | |
| if [ ${PARENT_CMD:0:5} = "sshd:" ]; then | |
| { notidle 2>&3 & } 3>&2 2>/dev/null | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment