This file contains hidden or 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
#!/bin/bash | |
# Identify location of jamf binary. | |
jamf_binary=`/usr/bin/which jamf` | |
if [[ "$jamf_binary" == "" ]] && [[ -e "/usr/sbin/jamf" ]] && [[ ! -e "/usr/local/bin/jamf" ]]; then | |
jamf_binary="/usr/sbin/jamf" | |
elif [[ "$jamf_binary" == "" ]] && [[ ! -e "/usr/sbin/jamf" ]] && [[ -e "/usr/local/bin/jamf" ]]; then | |
jamf_binary="/usr/local/bin/jamf" |
This file contains hidden or 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
/usr/bin/top -l 1 > /tmp/top-scratch.txt && less /tmp/top-scratch.txt >> /tmp/top-output.txt && /bin/rm /tmp/top-scratch.txt |
This file contains hidden or 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
#!/bin/bash | |
# This script is designed to automate the setup of OS X Server 5.0.3 and later | |
# by authorizing and using the 'server' tool within /Applications/Server.app to | |
# run the initial setup and configuration of OS X Server's services. | |
# Script will check for the existence of the 'server' setup tool. If the 'server' setup tool | |
# is not located where the script expects it to be, the script will exit. | |
if [[ ! -e "/Applications/Server.app/Contents/ServerRoot/usr/sbin/server" ]]; then |
This file contains hidden or 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
#!/bin/bash | |
CheckBinary (){ | |
# Identify location of jamf binary. | |
jamf_binary=`/usr/bin/which jamf` | |
if [[ "$jamf_binary" == "" ]] && [[ -e "/usr/sbin/jamf" ]] && [[ ! -e "/usr/local/bin/jamf" ]]; then | |
jamf_binary="/usr/sbin/jamf" |
This file contains hidden or 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
#!/bin/bash | |
homefolder="$(mdls -raw -name kMDItemFSCreationDate $HOME | awk '{ print $1 }')" | |
if [[ "$homefolder" == $(date +"%Y-%m-%d") ]]; then | |
echo "Created today!" | |
fi |
This file contains hidden or 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
<?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>TALLogoutSavesState</key> | |
<string>0</string> | |
</dict> | |
</plist> |
This file contains hidden or 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
#!/bin/bash | |
# Disabling First-run dialogs in Office 2016 for Mac | |
# Link: http://macops.ca/disabling-first-run-dialogs-in-office-2016-for-mac/ | |
if [[ -e "/Applications/Microsoft Excel.app" ]]; then | |
/usr/bin/defaults write /Library/Preferences/com.microsoft.Excel kSubUIAppCompletedFirstRunSetup1507 -bool true | |
elif [[ -e "/Applications/Microsoft OneNote.app" ]]; then | |
/usr/bin/defaults write /Library/Preferences/com.microsoft.onenote.mac kSubUIAppCompletedFirstRunSetup1507 -bool true | |
elif [[ -e "/Applications/Microsoft Outlook.app" ]]; then |
This file contains hidden or 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
java -version 2>&1 | awk 'NR==1{ gsub(/"/,""); print $3 }' |
This file contains hidden or 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
defaults read $(/usr/libexec/java_home | sed 's/Home//g' | sed s'/.$//')/Info CFBundleIdentifier | grep -o "apple" | |
defaults read $(/usr/libexec/java_home | sed 's/Home//g' | sed s'/.$//')/Info CFBundleIdentifier | grep -o "oracle" | |
Answer: defaults read $(/usr/libexec/java_home | sed 's/Home//g' | sed s'/.$//')/Info CFBundleIdentifier | grep -o "apple\|oracle" |
This file contains hidden or 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
###Test Code### | |
### Intention is to figure out what JDK the user has installed. | |
### our current Ext atty reports the JRE, we need to know they have the JDK | |
## thanks to elliotjordon | |
## -00 is just a number to say that JDK is not installed. makes for better smartgroup searches | |
############### | |
if JDKver=$(ls "/Library/Java/JavaVirtualMachines" | awk -F "_|.jdk" '/.jdk/{print $2}' | tail -1) | |
then | |
echo "<result>$JDKver</result>" | |
# else |