Re:Can You Grok It – Hacking Together Your Own Dev Tunnel Se...
by 0xdade on Monday April 15, 2024 @12:12AM
(#40037012)
Ohh so I just gave this a shot and I think that the trap runs when `.ssh/rc` exits, which is immediately when my bash prompt shows up. But if I want to make it non-interactive (in a really hacky way) then I can have my .ssh/rc file just infinitely sleep if domain is defined. Then I killed the ssh connection via a `kill` command on the client side and it appropriately cleaned up the socket file in tmp.
I combined this infinite loop in ssh rc and a -T and a simple command "echo hello" in my client function and now it prints out the link to visit, hangs infinitely until I close it or it gets closed, and cleans itself up.
This just took the level of hackishness to new heights and I love it.
Re:Can You Grok It – Hacking Together Your Own Dev Tunnel Se...
by cbluth on Monday April 15, 2024 @01:03AM
(#40037220)
Using a trap didn't work?
Re:Can You Grok It – Hacking Together Your Own Dev Tunnel Se...
by 0xdade on Sunday April 14, 2024 @10:43PM
(#40036603)
Oooh, I hadn't considered HUP. I tried to use a cleanup script with a bash trap on I think INT and KILL but it didn't seem to work correctly. I had also never tried to use a trap command, though, so there was a good chance I was doing it wrong lol. I'll give this a shot!
In .ssh/rc: