3
1
I'm new to Terminal, so feel free to state the obvious.
SleepWatcher runs scripts right before and after your Mac goes to sleep. I've got a script to unmount an external disk before sleep, then remount it after. (That way, when I'm rushing to get to work in the morning, I can just close the lid, pull out all the cables and not get a "You didn't eject it, jerk!" complaint.)
The scripts run fine and it unmounts right before sleep. But, it won't remount after wake.
#!/bin/sh
diskutil mount 8851F3A7-60A7-39A7-9DA8-41BE1499DE6C
I can run this script manually in Terminal. It'll work then. SleepWatcher can execute the script (I can get it to display a dialog box), just not the command to mount.
What am I missing?
Update: I've chmod-ed the scripts as +x. Can diskutil be run as +x?
I didn't get
/usr/sbin/diskutil mountDisk
to work in the normal crontab (either directly or in a script), but it did work when run from the root's crontab or a per-user launchd job. – Lri – 2012-07-31T13:34:44.057