[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

detecting network change.



Is there a portable (not specific to how networking is configured) way of detecting a network change and forcing ssh to close.

At work I have an ubuntu laptop, when at my desk I'm using wired connection, when I go to a meeting it switches to wifi.

All my ssh sessions hang when this happens. Obviously, I can close them with <cr>~. and then reconnect, but I'm wondering if there's a neat way to automate the disconnect? Sometimes I'm waiting for a job to finish and the terminal never updates because nothing tries to transmit. It might be hours before I notice because I'm missing that flicker when something happens.

(I'm using screen to reestablish the session, that part is all working, it's just the explicit disconnect I want to automate)




Reply to: