Skip to content

Commit

Permalink
Merge pull request #7 from juanjonol/master
Browse files Browse the repository at this point in the history
Fix location of nobootsound_logoutvol
  • Loading branch information
matteoacrossi committed Mar 17, 2016
2 parents 2bb247e + 42cad6b commit fb01671
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions install.sh
@@ -1,8 +1,8 @@
#!/bin/bash
#
# Install the script by moving the two script files
# to the user home directory ~ (hiding them with a dot .)
# and then hooking them to the login and logout
# to the /Library/LogHook/ directory and then
# hooking them to the login and logout.
#

installation_folder="/Library/LogHook/"
Expand Down
4 changes: 3 additions & 1 deletion nobootsound_loginhook
Expand Up @@ -2,6 +2,8 @@
# Read the value stored in .noboot_logoutvol to determine wether the
# computer was muted before shutdown

read val < .nobootsound_logoutvol
logoutvolume="/Library/LogHook/nobootsound_logoutvol"

read val < "$logoutvolume"
logger "Nobootsound restoring volume to previous value. Mute: $val"
osascript -e "if not $val then set volume without output muted"
6 changes: 4 additions & 2 deletions nobootsound_logouthook
@@ -1,8 +1,10 @@
#!/bin/bash

logoutvolume="/Library/LogHook/nobootsound_logoutvol"

# Store the state of volume right before shutdown
osascript -e 'output muted of (get volume settings)' > .nobootsound_logoutvol
read val < .nobootsound_logoutvol
osascript -e 'output muted of (get volume settings)' > "$logoutvolume"
read val < "$logoutvolume"
logger "Nobootsound. Volume muted before shutdown: $val"
# Mute volume, so that no sound will be played at boot
osascript -e 'set volume with output muted'

0 comments on commit fb01671

Please sign in to comment.