X-Git-Url: https://code.delx.au/refind/blobdiff_plain/fe0f3d769a97966be67a9a8c5404f574123f7b3a..cf4d4184e6a83cf0784b5f95c1b5e4868384ae0b:/mountesp diff --git a/mountesp b/mountesp index e1c35a7..6459199 100755 --- a/mountesp +++ b/mountesp @@ -1,4 +1,18 @@ #!/bin/bash +# +# Mac OS X script to locate and mount an EFI System Partition (ESP) +# +# Usage: +# +# ./mountesp +# +# This program is copyright (c) 2012-2015 by Roderick W. Smith +# It is released under the terms of the GNU GPL, version 3, +# a copy of which should be included in the file COPYING.txt. +# +# Revision history: +# +# 0.9.3 -- Initial release (with rEFInd 0.9.3) # Mount the ESP at /Volumes/ESP or determine its current mount # point. @@ -25,10 +39,15 @@ MountOSXESP() { fi fi Esp=/dev/`echo $Temp` + echo "The ESP has been identified as $Esp; attempting to mount it...." # If the ESP is mounted, use its current mount point.... Temp=`df -P | grep "$Esp "` MountPoint=`echo $Temp | cut -f 6- -d ' '` if [[ "$MountPoint" == '' ]] ; then + if [[ $UID != 0 ]] ; then + echo "You must run this program as root or using sudo! Exiting!" + exit 1 + fi MountPoint="/Volumes/ESP" mkdir /Volumes/ESP &> /dev/null mount -t msdos "$Esp" /Volumes/ESP