Wednesday, May 8, 2013

running a script on resume / suspend

I wrote a script to write my .ssh/config file according to my network location: using route I can detect which network I am running on and use that to select the appropriate ssh config options. But I had to run that script manually. Until I found a way to run a script automatically when my session is resumed.

The trick is to place scripts in /etc/pm/sleep.d. This is documented in pm-util man page.

No comments:

Post a Comment