Skip to content

Instantly share code, notes, and snippets.

@smashism
Created May 19, 2018 19:49
Show Gist options
  • Save smashism/44fea7cfe1fa5d4671b968871de86733 to your computer and use it in GitHub Desktop.
Save smashism/44fea7cfe1fa5d4671b968871de86733 to your computer and use it in GitHub Desktop.
#!/bin/bash
nameString="$4" # What to put in a name string
plistName="$5" # Name of the plist file (e.g., com.planetexpress.expendable.plist)
plistPath="$6" # Path to plist file (e.g., /Users/Shared/Careerchips)
currentDate=$(date +"%Y-%m-%d %H:%M:%S") # Creates date in format Jamf can use for date-based data type EA
defaults write $plistPath/$plistName name "$nameString" # Double-duty: will make plist if doesn't exist, then write the value!
defaults write $plistPath/$plistName date "$currentDate" # Date can be used in Jamf EA with "Date" data type.
# Dosvedanya, comrade!
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment