Execute a .command file on logout?
I used the defaults tool, and com.apple.loginwindow LogoutHook thing:
sudo defaults write com.apple.loginwindow LogoutHook /Users/admin/Desktop/ifconfdown_mutevol.commandAnd if I do:
sudo defaults read com.apple.loginwindow LogoutHook
it does show the path:
"/Users/admin/Desktop/ifconfdown_mutevol.command"
but the commands contained the file ifconfdown_mutevol.command ARE NOT executed:
"sudo ifconfig en0 down && sleep 1 && osascript -e "set Volume 0" && sleep 1 && osascript -e 'tell application "Terminal" to close (every window whose name contains ".command")' &
exit"
What's wrong? I know I'd use automator, but I'd prefer to do it manually as I want to learn about the structure of OS X more.
MacBook Air, OS X Yosemite (10.10.5)