Last active
November 24, 2020 17:52
-
-
Save kaedea/c8dca0d8c153d7795d977cf97604c09f to your computer and use it in GitHub Desktop.
Mount EFI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sh xxx.sh <password> | |
input=$1 | |
if [ ! "$input" ];then | |
input="default password" | |
fi | |
set -e | |
diskName=$(echo $input | sudo -S diskutil list | grep -e "EFI" | awk '{ print $3 }' | sed -n '1p') | |
diskNum=$(echo $input | sudo -S diskutil list | grep -e "EFI" | awk '{ print $6 }' | sed -n '1p') | |
diskSerialNum=$(echo $input | sudo -S diskutil info $diskNum | grep -e "Volume UUID:" | awk '{ print $3 }') | |
diskPath=$(echo $input | sudo -S diskutil info $diskSerialNum | grep -e "Device Node" | awk '{ print $3 }') | |
echo $input | sudo -S diskutil mount $diskPath | |
open "/Volumes/$diskName" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment