I use sshfs to do useful things on my dev box. I love it. But, I usually forget to fusermount -u before I close my lid (triggering hibernate). Then, when I come back, sshfs is frozen and I have to clean up.
I'd much rather have a script in /etc/pm/sleep.d that iterates over all my sshfs mountpoints and DWIM. I've got the fusermount -u code written with df -l checks. But, in testing, I've determined that I also need to cd out of all the mountpoints in order for fusermount -u to work.
But, I cannot figure out how to iterate over my open bash terminals and do useful things in them. Help?