Skip to content

Commit fb01671

Browse files
committed
Merge pull request #7 from juanjonol/master
Fix location of nobootsound_logoutvol
2 parents 2bb247e + 42cad6b commit fb01671

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

install.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22
#
33
# Install the script by moving the two script files
4-
# to the user home directory ~ (hiding them with a dot .)
5-
# and then hooking them to the login and logout
4+
# to the /Library/LogHook/ directory and then
5+
# hooking them to the login and logout.
66
#
77

88
installation_folder="/Library/LogHook/"

nobootsound_loginhook

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Read the value stored in .noboot_logoutvol to determine wether the
33
# computer was muted before shutdown
44

5-
read val < .nobootsound_logoutvol
5+
logoutvolume="/Library/LogHook/nobootsound_logoutvol"
6+
7+
read val < "$logoutvolume"
68
logger "Nobootsound restoring volume to previous value. Mute: $val"
79
osascript -e "if not $val then set volume without output muted"

nobootsound_logouthook

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
22

3+
logoutvolume="/Library/LogHook/nobootsound_logoutvol"
4+
35
# Store the state of volume right before shutdown
4-
osascript -e 'output muted of (get volume settings)' > .nobootsound_logoutvol
5-
read val < .nobootsound_logoutvol
6+
osascript -e 'output muted of (get volume settings)' > "$logoutvolume"
7+
read val < "$logoutvolume"
68
logger "Nobootsound. Volume muted before shutdown: $val"
79
# Mute volume, so that no sound will be played at boot
810
osascript -e 'set volume with output muted'

0 commit comments

Comments
 (0)