Created
April 2, 2018 22:10
-
-
Save kitzy/1052b8c3c046057aacdde3398e2bf5ce to your computer and use it in GitHub Desktop.
Expands the Jamf Pro ROOT.war, extracts the version number, and renames the ROOT.war file to include the version number.
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 | |
if [ -z $1 ] | |
then | |
echo "ROOT.war must be passed as the first arguement to this script!" | |
exit 1 | |
fi | |
warFile=$1 | |
mkdir -p '/tmp/jamf' | |
unzip $warFile -d '/tmp/jamf' | |
version=$(cat /tmp/jamf/WEB-INF/xml/version.xml | grep '<version>' -m 1 | awk -F '<|>|</' '{print $3}') | |
cp $1 "JSS_$version.war" | |
rm -rf '/tmp/jamf' | |
echo "Jamf Pro version is $version" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment