-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Admin Condition for FileVault Status
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# .DS_Store files! | ||
.DS_Store | ||
|
||
# our build directory | ||
build/ |
22 changes: 22 additions & 0 deletions
22
conditionals/AdminCondition FileVault Enabled/build-info.plist
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>distribution_style</key> | ||
<false/> | ||
<key>identifier</key> | ||
<string>com.github.munki.pkg.AdminConditionFileVaultEnabled</string> | ||
<key>install_location</key> | ||
<string>/</string> | ||
<key>name</key> | ||
<string>AdminConditionFileVaultEnabled-${version}.pkg</string> | ||
<key>ownership</key> | ||
<string>recommended</string> | ||
<key>postinstall_action</key> | ||
<string>none</string> | ||
<key>suppress_bundle_relocation</key> | ||
<true/> | ||
<key>version</key> | ||
<string>1.0</string> | ||
</dict> | ||
</plist> |
20 changes: 20 additions & 0 deletions
20
.../AdminCondition FileVault Enabled/payload/usr/local/munki/conditions/filevault-enabled.sh
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# This is a bash conditional script which outputs a key with a value of the current filevault enabled status | ||
|
||
# Read the location of the ManagedInstallDir from ManagedInstall.plist | ||
managedinstalldir="$(defaults read /Library/Preferences/ManagedInstalls ManagedInstallDir)" | ||
# Make sure we're outputting our information to "ConditionalItems.plist" | ||
plist_loc="$managedinstalldir/ConditionalItems" | ||
|
||
statusOn=`/usr/bin/fdesetup status | grep On` | ||
|
||
if [ ! -z "$statusOn" ]; then | ||
defaults write "$plist_loc" "filevault_enabled" -bool true | ||
else | ||
defaults write "$plist_loc" "filevault_enabled" -bool false | ||
fi | ||
|
||
# convert plist to xml | ||
plutil -convert xml1 "$plist_loc".plist | ||
|
||
exit 0 |
3 changes: 3 additions & 0 deletions
3
conditionals/AdminCondition FileVault Enabled/scripts/postinstall
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
chmod +x /usr/local/munki/conditions/filevault-enabled.sh |