[Discuss] Ideas for solving a remove backup quandary

Steven Kurylo sk at infinitepigeons.org
Tue May 13 16:06:41 PDT 2008


On Tue, May 13, 2008 at 4:02 PM, Jeremy Kiffiak <jeremy at truesolutions.ca> wrote:
> Chris,
>
>  Thanks again, that did the trick as far as setting up the tunnel.  Next
> question:
>
>  How do I get the tunnel to delete itself after the script has completed
> successfully (or even not completed successfully)?

Save the pid and kill it at the end of the script.

ssh -P 10022 -C -f -N -L 127.0.0.1:10033:192.168.10.150:22<username>@remotegw1
ssh_pid=$!
[... do stuff ...]
kill $ssh_pid


More information about the Discuss mailing list