Disable the startup chime via Unix scripts

Oct 17, '05 05:19:00AM

Contributed by: Anonymous

There have been other hints on this, but I thought I'd post a very simple way for UNIX admins to disable their startup chime.

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...]

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20051013141919568