Skip to content

Commit

Permalink
Utilities: Unmount ESP after copying for more security
Browse files Browse the repository at this point in the history
  • Loading branch information
PMheart committed Jul 17, 2019
1 parent eb83b4a commit 6af3174
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Utilities/LogoutHook/LogoutHook.command
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ UUID="$("${nvram}" 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-path | /usr/bin/sed
if [ "$(printf "${UUID}" | /usr/bin/wc -c)" -eq 36 ] && [ -z "$(echo "${UUID}" | /usr/bin/sed 's/[-0-9A-F]//g')" ]; then
/usr/sbin/diskutil mount "${UUID}" || abort "Failed to mount ${UUID}!"
/bin/cp ./nvram.plist "$(/usr/sbin/diskutil info "${UUID}" | /usr/bin/sed -n 's/.*Mount Point: *//p')" || abort "Failed to copy nvram.plist!"
/usr/sbin/diskutil unmount "${UUID}" || abort "Failed to unmount ${UUID}!"
exit 0
else
abort "Illegal UUID or unknown loader!"
Expand Down

0 comments on commit 6af3174

Please sign in to comment.