Skip to content

Instantly share code, notes, and snippets.

@jankais3r
Last active April 27, 2019 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jankais3r/1628688baf8d8e066817c51359cacfe0 to your computer and use it in GitHub Desktop.
Save jankais3r/1628688baf8d8e066817c51359cacfe0 to your computer and use it in GitHub Desktop.
Apple Script that automates the mounting process of a Bitlocker partition
--More details in this thread: https://twitter.com/jankais3r/status/1069974420150804480
tell application "Terminal"
if not (exists window 1) then reopen
activate
do script "sudo -n mount-dislocker /dev/disk0s3 `base64 -D <<< YourBitlockerPasswordEncodedInBase64GoesHere` ; exit" in window 1
repeat while (exists window 1)
end repeat
quit
end tell
tell application "Terminal"
if not (exists window 1) then reopen
activate
do script "sed -i '' -e '$ d' ~/.bash_history; exit" in window 1
repeat while (exists window 1)
end repeat
quit
end tell
tell application "Terminal"
if not (exists window 1) then reopen
activate
do script "sudo -n umount-dislocker /dev/disk0s3 ; exit" in window 1
repeat while (exists window 1)
end repeat
quit
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment