This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update install.sh to not require manually editing files.
- Loading branch information
1 parent
04b78e5
commit a48e3ca
Showing
3 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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 |