Skip to content

Instantly share code, notes, and snippets.

@nicwolff
Created March 6, 2015 20:21
Show Gist options
  • Select an option

  • Save nicwolff/0393602c5ff67ef0c15a to your computer and use it in GitHub Desktop.

Select an option

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
# 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