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
#!/bin/bash | |
args=("$@") | |
jssAPIUsername='' | |
jssAPIPassword='' | |
jssAddress="" | |
file="${args[0]}" | |
#Verify we can read the file | |
data=`cat $file` | |
if [[ "$data" == "" ]]; then |
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
#!/bin/bash | |
# originally written by @franton | |
osvers_major=$(/usr/bin/sw_vers -productVersion | awk -F. '{print $1}') | |
osvers_minor=$(/usr/bin/sw_vers -productVersion | awk -F. '{print $2}') | |
osvers_dot_version=$(/usr/bin/sw_vers -productVersion | awk -F. '{print $3}') | |
if [[ "$osvers_major" -eq 10 && "$osvers_minor" -lt 13 ]]; then | |
echo "<result>Older macOS version</result>" |
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
#!/bin/bash | |
args=("$@") | |
pkgName="${args[0]}" | |
echo "Supply the package name and version: build.sh <pkgname> <version>" | |
# get date for package name | |
myDate=`date +%Y%m%d` | |
# Name of the package. | |
NAME="${pkgName}" |
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
#!/bin/bash | |
args=("$@") | |
pkgName="${args[0]}" | |
echo "Supply the package name and version: build.sh <pkgname> <version>" | |
# get date for package name | |
myDate=`date +%Y%m%d` | |
# Name of the package. | |
NAME="${pkgName}" |
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
#!/bin/bash | |
## basic package, not signed. Provide name you want and version as command line arguments. | |
args=("$@") | |
pkgName="${args[0]}" | |
echo "Supply the package name and version: build.sh <pkgname> <version>" | |
# get date for package name | |
myDate=`date +%Y%m%d` |
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
## upload log to JPS | |
xpath() { | |
# the xpath tool changes in Big Sur | |
if [[ $(sw_vers -buildVersion) > "20A" ]]; then | |
/usr/bin/xpath -e "$@" | |
else | |
/usr/bin/xpath "$@" | |
fi | |
} |
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
curl -sku $apiUser:$apiPass $jpsURL/JSSResource/fileuploads/computers/id/$JSS_ID -F name=@${mylog} -X POST |
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
JSS_ID=$(curl -H "Accept: text/xml" -sfku "${jss_user}:${jss_pass}" "${jss_url}/JSSResource/computers/serialnumber/${serial}/subset/general" | xpath /computer/general/id[1] | awk -F'>|<' '{print $3}') |
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
serial=$(system_profiler SPHardwareDataType | awk '/Serial\ Number\ \(system\)/ {print $NF}'); |
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
#!/bin/zsh | |
mylogpath=/tmp/mylog | |
mylog=$mylogpath/myawesomlog-$(date +%Y%m%d-%H%M).log | |
[[ ! -d ${mylogpath} ]]; mkdir -p $mylogpath | |
set -xv; exec 1> $mylog 2>&1 | |
... do some stuff ... |
NewerOlder