Skip to content

Commit

Permalink
Merge pull request #28 from SecondSonConsulting/2.0-beta2
Browse files Browse the repository at this point in the history
v2.0
  • Loading branch information
BigMacAdmin authored Jan 17, 2024
2 parents b03c766 + ba64a6a commit bb3a245
Show file tree
Hide file tree
Showing 9 changed files with 1,142 additions and 207 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Build/.DS_Store
.DS_Store
.DS_Store
Build/.DS_Store
TestConfig.plist
925 changes: 748 additions & 177 deletions Baseline.sh

Large diffs are not rendered by default.

34 changes: 20 additions & 14 deletions Build/Baseline_daemon-postinstall.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
#!/bin/zsh
#set -x

#Set variables for path/name
# Set variables for path/name
launchDPath="/Library/LaunchDaemons"
launchDName="com.secondsonconsulting.baseline"

#Load the launch daemon
launchctl bootstrap system "$launchDPath"/"$launchDName".plist > /dev/null 2>&1
result=$(echo $?)
# Function to exit with an error message
exit_with_error() {
echo "Error: $1" >&2
exit 1
}

#Test if the bootstrap command failed
if [ "$result" != 0 ]; then
exit 1
# Load the launch daemon
launchctl bootstrap system "$launchDPath/$launchDName.plist" > /dev/null 2>&1
bootstrap_result=$?

# Test if the bootstrap command failed
if [ "$bootstrap_result" -ne 0 ]; then
exit_with_error "Failed to load the launch daemon."
fi

#Check if the launch daemon is actually running
# Check if the launch daemon is actually running
launchctl list "$launchDName" > /dev/null 2>&1
LIST_result=$(echo $?)
list_result=$?

#Exit fail if the launch daemon isn't loaded
if [ "$result" != 0 ]; then
exit 1
# Exit fail if the launch daemon isn't loaded
if [ "$list_result" -ne 0 ]; then
exit_with_error "Launch daemon is not running."
fi

exit 0
# Successful exit
exit 0
32 changes: 22 additions & 10 deletions Build/Baseline_daemon-preinstall.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
#!/bin/zsh
#set -x

# Function to exit with an error message
exit_with_error() {
echo "Error: $1" >&2
exit 1
}

# Set path and name variables
launchDPath="/Library/LaunchDaemons"
launchDName="com.secondsonconsulting.baseline"

# Check if the launch daemon is running
launchctl list "$launchDName" > /dev/null 2>&1
listResult=$(echo $?)
list_result=$?

# If daemon is running, attempt to unload and remove it
if [ "$list_result" -eq 0 ]; then
launchctl bootout system/"$launchDName"
bootout_result=$?

if [ "$bootout_result" -ne 0 ]; then
exit_with_error "Failed to unload the launch daemon."
fi

if [ "$listResult" = 0 ]; then
launchctl bootout system/"$launchDName"
unloadResult=$(echo $?)
if [ "$unloadResult" != 0 ]; then
echo "UNLOAD FAILED"
fi
rm "$launchDPath"/"$launchDName".plist
# Remove plist file
rm "$launchDPath/$launchDName.plist" || true
fi

exit 0
# Successful exit
exit 0
Binary file added Build/Icons/ExampleIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions ExampleConfigurationFiles/Baseline-ProductionExample.mobileconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@
<dict>
<key>DisplayName</key>
<string>Google Chrome</string>
<key>Icon</key>
<string>ExampleIcon.png</string>
<key>Label</key>
<string>googlechromepkg</string>
</dict>
<dict>
<key>DisplayName</key>
<string>Microsoft Office 365</string>
<key>Icon</key>
<string>SF=doc.circle,color=blue</string>
<key>Label</key>
<string>microsoftoffice365</string>
</dict>
<dict>
<key>DisplayName</key>
<string>Zoom</string>
<key>Icon</key>
<string>SF= video.circle,color=blue</string>
<key>Label</key>
<string>zoom</string>
</dict>
Expand All @@ -31,6 +37,8 @@
<dict>
<key>DisplayName</key>
<string>Mist v0.5</string>
<key>Icon</key>
<string>https://github.com/ninxsoft/Mist/blob/main/README%20Resources/App%20Icon.png?raw=true</string>
<key>PackagePath</key>
<string>https://github.com/ninxsoft/Mist/releases/download/v0.5/Mist.0.5.pkg</string>
<key>TeamID</key>
Expand All @@ -44,14 +52,16 @@
<key>PayloadType</key>
<string>com.secondsonconsulting.baseline</string>
<key>PayloadUUID</key>
<string>97DE51A6-850F-46AB-98A6-BD9A80F7AF36</string>
<string>75A6163E-E581-4E91-88B7-17927BF9667A</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>Scripts</key>
<array>
<dict>
<key>DisplayName</key>
<string>Enabling Location Services</string>
<key>Icon</key>
<string>/System/Library/PrivateFrameworks/AOSUI.framework/Versions/A/Resources/findmy.icns</string>
<key>MD5</key>
<string>c32364f1f3f7fc2410e265d82095feee</string>
<key>ScriptPath</key>
Expand All @@ -73,7 +83,7 @@
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>B842AE0F-70AE-4C1C-8556-D28F10168D89</string>
<string>BEDFC054-5B20-430F-B388-A51C3B4D30AE</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
Expand Down
199 changes: 199 additions & 0 deletions ProfileManifest/com.secondsonconsulting.baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
{
"title": "Baseline by Second Son Consulting (com.secondsonconsulting.baseline)",
"description": "Baseline by Second Son Consulting Configuration",
"properties": {
"InitialScripts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"DisplayName": {
"type": "string",
"title": "Display Name",
"description": "The name you want to appear in the SwiftDialog menu as this script is run."
},
"ScriptPath": {
"type": "string",
"title": "Script Path",
"description": "A path to the script you want to run. Can be a local file path or a URL."
},
"MD5": {
"type": "string",
"title": "MD5",
"description": "The expected MD5 of the script being run."
},
"Arguments": {
"type": "string",
"title": "Arguments",
"description": "Arguments you want to pass to the script when it is run."
}
}
},
"title": "InitialScripts",
"description": "Define scripts that are run immediately as the user logs in.",
"property_order": 5
},
"Installomator": {
"type": "array",
"items": {
"type": "object",
"properties": {
"DisplayName": {
"type": "string",
"title": "Display Name",
"description": "The name you want to appear in the SwiftDialog menu as this Installomator label is processed."
},
"Label": {
"type": "string",
"title": "Label",
"description": "The Installomator label."
},
"Arguments": {
"type": "string",
"title": "Arguments",
"description": "Arguments you want to pass to the Installomator command for this label."
},
"Icon": {
"type": "string",
"title": "Icon",
"description": "The icon you want to appear in the SwiftDialog menu as this Installomator label is processed. Can be a URL or local file path."
}
}
},
"title": "Installomator Labels",
"description": "Define Installomator labels to be run by Baseline.",
"property_order": 10
},
"Packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"DisplayName": {
"type": "string",
"title": "Display Name",
"description": "The name you want to appear in the SwiftDialog menu as this package is installed."
},
"PackagePath": {
"type": "string",
"title": "Package Path",
"description": "A path to the package you want to install. Can be a local file path or a URL."
},
"TeamID": {
"type": "string",
"title": "TeamID",
"description": "The expected TeamID of the package being installed."
},
"MD5": {
"type": "string",
"title": "MD5",
"description": "The expected MD5 of the package being installed."
},
"Arguments": {
"type": "string",
"title": "Arguments",
"description": "Arguments you want to pass to the installer command for this package."
},
"Icon": {
"type": "string",
"title": "Icon",
"description": "The icon you want to appear in the SwiftDialog menu as this package is installed. Can be a URL or local file path."
}
}
},
"title": "Packages",
"description": "Define Packages to be run by Baseline",
"property_order": 15
},
"Scripts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"DisplayName": {
"type": "string",
"title": "Display Name",
"description": "The name you want to appear in the SwiftDialog menu as this script is run."
},
"ScriptPath": {
"type": "string",
"title": "Script Path",
"description": "A path to the script you want to run. Can be a local file path or a URL."
},
"MD5": {
"type": "string",
"title": "MD5",
"description": "The expected MD5 of the script being run."
},
"Arguments": {
"type": "string",
"title": "Arguments",
"description": "Arguments you want to pass to the script when it is run."
},
"Icon": {
"type": "string",
"title": "Icon",
"description": "The icon you want to appear in the SwiftDialog menu as this script is run. Can be a URL or local file path."
}
}
},
"title": "Scripts",
"description": "Define Scripts to be run by Baseline",
"property_order": 20
},
"Restart": {
"type": "boolean",
"title": "Force Restart",
"description": "This setting controls whether Baseline forces a restart after completion. Default is true.",
"property_order": 25
},
"LogOut": {
"type": "boolean",
"title": "Force Log Out",
"description": "This setting controls whether Baseline forces a restart after completion. Default is true.",
"property_order": 30
},
"ProgressBar": {
"type": "boolean",
"title": "Show Progress Bar",
"description": "This setting controls whether Baseline displays a progress bar. Default is false.",
"property_order": 35
},
"ProgressBarDisplayNames": {
"type": "boolean",
"title": "Show Display Names on Progress Bar",
"description": "This setting controls whether Baseline displays the current item being processed under the progress bar. Default is false.",
"property_order": 40
},
"CleanupAfterUse": {
"type": "boolean",
"title": "Cleanup After Use",
"description": "This setting controls whether Baseline deletes it's install directory after use: /usr/local/Baseline.",
"property_order": 45
},
"DialogListOptions": {
"type": "string",
"title": "Dialog List Window Options",
"description": "SwiftDialog options for the primary Baseline progress list window.",
"property_order": 50
},
"DialogSuccessOptions": {
"type": "string",
"title": "Dialog Success Window Options",
"description": "SwiftDialog options for the Success Dialog window.",
"property_order": 55
},
"DialogFailureOptions": {
"type": "string",
"title": "Dialog Failure Window Options",
"description": "SwiftDialog options for the Failure Dialog window.",
"property_order": 60
},
"ExitCondition": {
"type": "string",
"title": "Exit Condition",
"description": "Define a file or folder path. If this file or folder exists, Baseline will exit quietly without processing any items.",
"property_order": 65
}
}
}
Loading

0 comments on commit bb3a245

Please sign in to comment.