-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
720db1f
commit 0e10784
Showing
5 changed files
with
399 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# shellcheck shell=bash | ||
# NOTE THIS FILE IS FOR USE IN THE EXAMPLES ONLY; USE 'jhelper prep' to generate. | ||
JHELPER="../dist/jhelper.phar" | ||
JH_PASS="${JHELPER} badge --format=pass " | ||
JH_SUCCESS="${JHELPER} badge --format=success " | ||
JH_FAIL="${JHELPER} badge --format=fail " | ||
JH_ERROR="${JHELPER} badge --format=error " | ||
JH_MSG="${JHELPER} msg --width=50 " |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
|
||
### region ############################################ DocBlock | ||
# | ||
# Installs the latest Adobe Acrobat Reader DC version, using | ||
# JHelper for the heavy lifting. | ||
# | ||
# Credit to Joe Farage for the concepts in the version function(s) | ||
# which were adapted from his scripts, written 3/18/2015. | ||
# | ||
### endregion ######################################### DocBlock | ||
|
||
### region ############################################ Dependencies | ||
|
||
[ -n "$(which jhelper)" ] || jamf policy --trigger InstallJHelper || (echo "ERROR: JHelper Not Installed" && exit 1) | ||
|
||
# shellcheck source=_jhelper.sh | ||
source "$(jhelper prep)" | ||
|
||
### endregion ######################################### Dependencies | ||
|
||
### region ############################################ Functions | ||
|
||
function getLatestVersion() { | ||
local OSvers_URL userAgent latestver latestvernorm i | ||
|
||
## Get OS version and adjust for use with the URL string | ||
OSvers_URL=$( sw_vers -productVersion | sed 's/[.]/_/g' ) | ||
|
||
## Set the User Agent string for use with curl | ||
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X ${OSvers_URL}) AppleWebKit/535.6.2 (KHTML, like Gecko) Version/5.2 Safari/535.6.2" | ||
|
||
# Get the latest version of Adobe Reader DC available from Adobe Reader page. | ||
for i in {1..5} | ||
do | ||
if [ -z "$latestver" ]; then | ||
latestver=$(curl -LSs -A "$userAgent" "https://get.adobe.com/reader" | grep "id=\"AUTO_ID_columnleft_p_version\"" | awk -F '\\>Version ' '{print $NF}' | awk -F\< '{print $1}') | ||
fi | ||
done | ||
|
||
if [ -n "$latestver" ]; then | ||
latestvernorm=$(echo "${latestver}" | sed -e 's/20//') | ||
echo "$latestvernorm" | ||
fi | ||
|
||
return 0 | ||
} | ||
|
||
function getAdobeReaderUrl() { | ||
local VERSION NORMALIZED | ||
|
||
VERSION=${1} | ||
NORMALIZED=$( echo "${VERSION}" | sed -e 's/[.]//g' ) | ||
|
||
echo "http://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/${NORMALIZED}/AcroRdrDC_${NORMALIZED}_MUI.dmg" | ||
|
||
return 0; | ||
} | ||
|
||
### endregion ######################################### Functions | ||
|
||
# Display Message | ||
echo "" | ||
$JH_MSG "Checking Current Version" | ||
# Get Current Version | ||
CURRENT=$(getLatestVersion) | ||
# Display Badge & Exit if No Version Given | ||
([ -n "${CURRENT}" ] && $JH_SUCCESS) || ($JH_ERROR && exit 1) | ||
|
||
# Set Variables | ||
APP_PATH="/Applications/Adobe Acrobat Reader DC.app" | ||
APP_URL=$(getAdobeReaderUrl "${CURRENT}") | ||
|
||
# Install DMG | ||
if $JHELPER install:dmg "${APP_PATH}" "${APP_URL}" --target="${CURRENT}"; then | ||
echo "" && exit 0 | ||
else | ||
echo "" && exit 1 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
### region ############################################ DocBlock | ||
# | ||
# Installs the latest Google Chrome Enterprise version, using | ||
# JHelper for the heavy lifting. | ||
# | ||
# Credit to Joe Farage for the concepts in the version function(s) | ||
# which were adapted from his scripts, written 3/18/2015. | ||
# | ||
### endregion ######################################### DocBlock | ||
|
||
### region ############################################ Dependencies | ||
|
||
[ -n "$(which jhelper)" ] || jamf policy --trigger InstallJHelper || (echo "ERROR: JHelper Not Installed" && exit 1) | ||
|
||
# shellcheck source=_jhelper.sh | ||
source "$(jhelper prep)" | ||
|
||
### endregion ######################################### Dependencies | ||
|
||
### region ############################################ Functions | ||
|
||
function getLatestVersion() { | ||
local OSvers_URL userAgent lVersion | ||
## Get OS version and adjust for use with the URL string | ||
OSvers_URL=$( sw_vers -productVersion | sed 's/[.]/_/g' ) | ||
|
||
## Set the User Agent string for use with curl | ||
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X ${OSvers_URL}) AppleWebKit/535.6.2 (KHTML, like Gecko) Version/5.2 Safari/535.6.2" | ||
|
||
# Get the latest version of Firefox available from Firefox page. | ||
lVersion=$(/usr/bin/curl -s -A "$userAgent" https://omahaproxy.appspot.com/json | jq -r ".[] | select(.os==\"mac\").versions[] | select(.channel==\"stable\").current_version" ) | ||
if [ -z "$lVersion" ]; then | ||
lVersion="ERROR" | ||
fi | ||
|
||
echo "${lVersion}" | ||
} | ||
|
||
### endregion ######################################### Functions | ||
|
||
# Display Message | ||
echo "" | ||
$JH_MSG "Checking Current Version" | ||
# Get Current Version | ||
CURRENT=$(getLatestVersion) | ||
# Display Badge & Exit if No Version Given | ||
([ -n "${CURRENT}" ] && $JH_SUCCESS) || ($JH_ERROR && exit 1) | ||
|
||
# Set Variables | ||
APP_URL='https://dl.google.com/chrome/mac/stable/gcem/GoogleChrome.pkg' | ||
APP_PATH="/Applications/Google Chrome.app" | ||
|
||
# Install DMG | ||
if $JHELPER install:pkg "${APP_PATH}" "${APP_URL}" --target="${CURRENT}"; then | ||
echo "" && exit 0 | ||
else | ||
echo "" && exit 1 | ||
fi |
Oops, something went wrong.