5
3
I want to run a script when I shutdown or restart my iMac, running Snow Leopard.
I read somewhere that one could use the /etc/rc.shutdown.local for this, but it is not working for me.
For example, I put the following lines on it:
#!/bin/sh
/usr/bin/osascript -e "set volume with output muted"
If I run:
source /etc/rc.shutdown.local
it does indeed mute the sound. However, if I have the sound on and make a restart of the OS, the sound will still be on. Which I guess it means the script was not called.
Any ideas?
UPDATE: It is actually working now. I think it's just because the correct name is rc.local.shutdown and not rc.shutdown.local.
The boot chime is definitely mutable. It follows the mute/volume status of the internal audio device that was active at shutdown. Note, however, that headphone-volume is separate from the internal speaker's volume and modern hardware always plays the statup chime through the internal speaker, not through the headphone jack. – David C. – 2014-09-17T20:33:26.630
This seems a little bit backwards to me. Why don't you just run the muting script at startup? Keep in mind that the boot chime is no longer mutable on current-generation hardware. – NReilingh – 2011-03-04T02:48:46.757
Please add an answer to your own question if you figured it out yourself, and click the checkmark next to it. This will mark this question resolved. – Daniel Beck – 2011-03-05T16:11:14.167