Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Update install.sh to not require manually editing files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Jul 23, 2011
1 parent 04b78e5 commit a48e3ca
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ The LaunchDaemon will allow the system to unlock and mount CoreStorage encrypted
## Install

- Download and extract the [repo][].
- Edit `files/unlock.sh`, replacing \[UUID\] with the UUID of the CoreStorage Logical Volume you are trying to unlock (run `diskutil cs list` and search for the LV UUID; it will be a string like: "497C771B-63FE-461F-AD7B-0BEF9A6BA718"). Also replace \[PASSWORD\] with the passphrase you used to encrypt the drive.
- Run `./install.sh` in the terminal (you'll be asked for your password).
- Everything should be set up! Restart your computer to test.
- Find the UUID of the CoreStorage Logical Volume you are trying to unlock (run `diskutil cs list` in the terminal and search for the LV UUID; it will be a string like: "497C771B-63FE-461F-AD7B-0BEF9A6BA718").
- Run `./install.sh` in the terminal
- Enter the UUID when asked.
- Enter the passphrase you used to encrypt the drive when asked.
- Finally, enter your login password when asked.
- Everything should be set up! Restart your computer and log in to test.

## Uninstall

- Run `./uninstall.sh` in the terminal (you'll be asked for your password) to remove all traces from the system.
- Run `./uninstall.sh` in the terminal (you'll be asked for your login password) to remove all traces from the system.

## Limitations

- You're passphrase is stored in plain text. While not the best option, you're boot drive is already encrypted, meaning someone must already have a login password in order to read it.
- You're passphrase __cannot__ contain a '/' (forward slash).

## Problems?

Expand Down
2 changes: 1 addition & 1 deletion files/unlock.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ echo "Checking if drive is unlocked."
if [ "`diskutil cs list | grep Locked`" ]
then
echo "Unlocking drive."
diskutil cs unlockVolume [UUID] -passphrase [PASSWORD]
diskutil cs unlockVolume UUID -passphrase PASSWORD
fi
26 changes: 24 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
sudo mv ./files/* /Library/LaunchDaemons/
echo "What is the UUID of the drive?"
read uuid
echo "And the passphrase used to encrypt it?"
read password
echo ""
echo "--------------------------"
echo "Installing..."

# Make a temporary directory so that original files are not changed
mkdir ./tmp
cp ./files/* ./tmp/

# Preform some sed jiggery to change required values
sed "s/UUID/$uuid/" ./tmp/unlock.sh > ./tmp/unlock.sh.tmp
rm ./tmp/unlock.sh
sed "s/PASSWORD/$password/" ./tmp/unlock.sh.tmp > ./tmp/unlock.sh
rm ./tmp/unlock.sh.tmp

# Move them to the LaunchDaemons dir, and make sure they have the right permissions
sudo mv ./tmp/* /Library/LaunchDaemons/
sudo chown root:wheel /Library/LaunchDaemons/name.ridgewell.unlock.plist
sudo chown root:wheel /Library/LaunchDaemons/unlock.sh
sudo chmod 644 /Library/LaunchDaemons/name.ridgewell.unlock.plist
sudo chmod 755 /Library/LaunchDaemons/unlock.sh
sudo chmod 755 /Library/LaunchDaemons/unlock.sh

# Cleanup
rm -r ./tmp

0 comments on commit a48e3ca

Please sign in to comment.