This command is in my .bash_logout script to delete a temporary directory when I logout after running some processing:
/bin/rm -rf /tmp/tmpdir/
However, I usually have more than one connection to a machine and I'd like to have this executed only if it is the last connection to logout. Is it possible to check this and put and if statement in?