Created
February 19, 2016 17:49
-
-
Save paulera/2a7d69ff0b0984765d11 to your computer and use it in GitHub Desktop.
This command opens a tunnel using plink and automatically closes it after seconds specified in secs=$((<time in seconds>));
This file contains 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
plink.exe -ssh <tunnel params using -R, -L and -D> user@host "echo; echo; export PS1=;secs=$((3600)); while [ $secs -gt 0 ]; do echo -ne \"This tunnel will auto-shutdown in: $secs \\r\"; sleep 1; : $((secs--)); done; echo -ne \"Tunnel closed! \"; echo; echo;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment