First, create the following file as /etc/rc.shutdown.local:
#!/bin/sh
OSA=/usr/bin/osascript
echo OUTPUT_MUTED=`$OSA -e "output muted of (get volume settings)"`
> /etc/volume.settings
$OSA -e "set volume with output muted"
This will mute the system's volume on shutdown, while saving its previous status. Next, create /etc/rc.local:
#!/bin/sh
OSA=/usr/bin/osascript
if [ -r /etc/volume.settings ]; then
. /etc/volume.settings
# If the volume wasn't muted before shutting down, unmute it on
# startup
if [ $OUTPUT_MUTED = "false" ]; then
$OSA -e "set volume without output muted"
fi
fi
This will unmute the volume if it was muted before.
[robg adds: I haven't tested this one...]

