mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Merge pull request #738 from Theile/MDM-scripts-logging-changes
Mdm scripts logging changes
This commit is contained in:
@@ -5,7 +5,11 @@
|
|||||||
|
|
||||||
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
|
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
|
||||||
|
|
||||||
#item="gfxcardstatus" # enter the software to install (if it has a label in future version of Installomator)
|
# Have the label been submittet in a PR for Installomator?
|
||||||
|
# What version of Installomator is it expected to be included in?
|
||||||
|
# Version 10.0
|
||||||
|
|
||||||
|
item="gfxcardstatus" # enter the software to install (if it has a label in future version of Installomator)
|
||||||
|
|
||||||
# Label variables below
|
# Label variables below
|
||||||
|
|
||||||
@@ -104,9 +108,10 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dial
|
|||||||
# INSTALL=force
|
# INSTALL=force
|
||||||
######################################################################
|
######################################################################
|
||||||
# To be used as a script sent out from a MDM.
|
# To be used as a script sent out from a MDM.
|
||||||
# Fill the variable "item" above with a label.
|
# Fill out the label variables above, and those will be included in the Installomator call, circa on line 248
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 10.0.3 : A bit more logging on succes, and change in ending Dialog part.
|
||||||
# v. 10.0.2 : Improved icon checks and failovers
|
# v. 10.0.2 : Improved icon checks and failovers
|
||||||
# v. 10.0.1 : github-functions added. Improved appIcon handling. Can add the app to Dock using dockutil.
|
# v. 10.0.1 : github-functions added. Improved appIcon handling. Can add the app to Dock using dockutil.
|
||||||
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
||||||
@@ -119,6 +124,10 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
|||||||
|
|
||||||
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
|
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
|
||||||
|
|
||||||
|
if [[ -z "$item" ]]; then
|
||||||
|
item="$name"
|
||||||
|
fi
|
||||||
|
|
||||||
dialogUpdate() {
|
dialogUpdate() {
|
||||||
# $1: dialog command
|
# $1: dialog command
|
||||||
local dcommand="$1"
|
local dcommand="$1"
|
||||||
@@ -129,19 +138,19 @@ dialogUpdate() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
checkCmdOutput () {
|
checkCmdOutput () {
|
||||||
# $1: cmdOutput
|
local checkOutput="$1"
|
||||||
local cmdOutput="$1"
|
exitStatus="$( echo "${checkOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$checkOutput"
|
||||||
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
|
#errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )"
|
||||||
#echo "$errorOutput"
|
#echo "$errorOutput"
|
||||||
fi
|
fi
|
||||||
|
#echo "$checkOutput"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check the currently logged in user
|
# Check the currently logged in user
|
||||||
@@ -176,9 +185,10 @@ caffexit () {
|
|||||||
# Mark: Installation begins
|
# Mark: Installation begins
|
||||||
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
||||||
|
|
||||||
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
|
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion | cut -c1-2) -lt 20 ]]; then
|
||||||
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
|
echo "Skipping swiftDialog UI, using notifications."
|
||||||
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
|
#echo "Installomator should be at least version 10 to support swiftDialog. Installed version $installomatorVersion."
|
||||||
|
#echo "And macOS 11 Big Sur (build 20A) is required for swiftDialog. Installed build $(sw_vers -buildVersion)."
|
||||||
installomatorNotify="NOTIFY=all"
|
installomatorNotify="NOTIFY=all"
|
||||||
else
|
else
|
||||||
installomatorNotify="NOTIFY=silent"
|
installomatorNotify="NOTIFY=silent"
|
||||||
@@ -187,7 +197,7 @@ else
|
|||||||
echo "Cannot find dialog at $dialogApp"
|
echo "Cannot find dialog at $dialogApp"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure and display swiftDialog
|
# Configure and display swiftDialog
|
||||||
@@ -200,24 +210,24 @@ else
|
|||||||
echo "$item $itemName"
|
echo "$item $itemName"
|
||||||
|
|
||||||
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
||||||
echo "icon before check: $icon"
|
#echo "icon before check: $icon"
|
||||||
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
||||||
echo "icon looks to be web-link"
|
#echo "icon looks to be web-link"
|
||||||
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
||||||
echo "ERROR: Cannot download link. Reset icon."
|
echo "ERROR: Cannot download ${icon} link. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
||||||
echo "icon looks to be a file"
|
#echo "icon looks to be a file"
|
||||||
if [[ ! -a "${icon}" ]]; then
|
if [[ ! -a "${icon}" ]]; then
|
||||||
echo "ERROR: Cannot find file. Reset icon."
|
echo "ERROR: Cannot find icon file ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: Cannot figure out icon. Reset icon."
|
echo "ERROR: Cannot figure out icon ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
echo "icon after first check: $icon"
|
#echo "icon after first check: $icon"
|
||||||
# If no icon defined we are trying to search for installed app icon
|
# If no icon defined we are trying to search for installed app icon
|
||||||
if [[ "$icon" == "" ]]; then
|
if [[ "$icon" == "" ]]; then
|
||||||
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
||||||
@@ -226,7 +236,7 @@ else
|
|||||||
appIcon="${appIcon}.icns"
|
appIcon="${appIcon}.icns"
|
||||||
fi
|
fi
|
||||||
icon="${appPath}/Contents/Resources/${appIcon}"
|
icon="${appPath}/Contents/Resources/${appIcon}"
|
||||||
echo "Icon before file check: ${icon}"
|
#echo "Icon before file check: ${icon}"
|
||||||
if [ ! -f "${icon}" ]; then
|
if [ ! -f "${icon}" ]; then
|
||||||
# Using LOGO variable to show logo in swiftDialog
|
# Using LOGO variable to show logo in swiftDialog
|
||||||
case $LOGO in
|
case $LOGO in
|
||||||
@@ -294,7 +304,7 @@ fi
|
|||||||
|
|
||||||
# Install software using Installomator with valuesfromarguments
|
# Install software using Installomator with valuesfromarguments
|
||||||
cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
|
cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
|
||||||
name=${name} \
|
name=\"${name}\" \
|
||||||
type=${type} \
|
type=${type} \
|
||||||
packageID=${packageID} \
|
packageID=${packageID} \
|
||||||
downloadURL=\"$downloadURL\" \
|
downloadURL=\"$downloadURL\" \
|
||||||
@@ -303,7 +313,7 @@ cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
|
|||||||
expectedTeamID=${expectedTeamID} \
|
expectedTeamID=${expectedTeamID} \
|
||||||
${installomatorOptions} ${installomatorNotify} || true)"
|
${installomatorOptions} ${installomatorNotify} || true)"
|
||||||
|
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
|
|
||||||
# Mark: dockutil stuff
|
# Mark: dockutil stuff
|
||||||
if [[ $addToDock -eq 1 ]]; then
|
if [[ $addToDock -eq 1 ]]; then
|
||||||
@@ -312,7 +322,7 @@ if [[ $addToDock -eq 1 ]]; then
|
|||||||
echo "Cannot find dockutil at $dockutil, trying installation"
|
echo "Cannot find dockutil at $dockutil, trying installation"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
echo "Adding to Dock"
|
echo "Adding to Dock"
|
||||||
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
||||||
@@ -322,9 +332,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Mark: Ending
|
# Mark: Ending
|
||||||
if [[ $installomatorVersion -lt 10 ]]; then
|
if [[ $installomatorVersion -ge 10 && $(sw_vers -buildVersion | cut -c1-2) -ge 20 ]]; then
|
||||||
echo "Again skipping Dialog stuff."
|
|
||||||
else
|
|
||||||
# close and quit dialog
|
# close and quit dialog
|
||||||
dialogUpdate "progress: complete"
|
dialogUpdate "progress: complete"
|
||||||
dialogUpdate "progresstext: Done"
|
dialogUpdate "progresstext: Done"
|
||||||
|
|||||||
@@ -5,15 +5,18 @@
|
|||||||
|
|
||||||
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
|
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
|
||||||
|
|
||||||
#item="" # enter the software to install (if it has a label in future version of Installomator)
|
# Have the label been submittet in a PR for Installomator?
|
||||||
|
# What version of Installomator is it expected to be included in?
|
||||||
|
# Version 10.0
|
||||||
|
|
||||||
|
item="clickshare" # enter the software to install (if it has a label in future version of Installomator)
|
||||||
|
|
||||||
# Variables for label
|
# Variables for label
|
||||||
name="ClickShare"
|
name="ClickShare" # If spaces in the name, fill out "${name}" in Installomator-call below, circa line 249. Spaces should be escaped in that line.
|
||||||
type="appInDmgInZip"
|
type="appInDmgInZip"
|
||||||
packageID=""
|
packageID=""
|
||||||
downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )"
|
downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )"
|
||||||
appNewVersion="$(eval "$( echo $downloadURL | sed -E 's/.*(MajorVersion.*BuildVersion=[0-9]*).*/\1/' | sed 's/&//g' )" ; ((MajorVersion++)) ; ((MajorVersion--)); ((MinorVersion++)) ; ((MinorVersion--)); ((PatchVersion++)) ; ((PatchVersion--)); ((BuildVersion++)) ; ((BuildVersion--)); echo "${MajorVersion}.${MinorVersion}.${PatchVersion}-b${BuildVersion}")"
|
appNewVersion="$(eval "$( echo $downloadURL | sed -E 's/.*(MajorVersion.*BuildVersion=[0-9]*).*/\1/' | sed 's/&//g' )" ; ((MajorVersion++)) ; ((MajorVersion--)); ((MinorVersion++)) ; ((MinorVersion--)); ((PatchVersion++)) ; ((PatchVersion--)); ((BuildVersion++)) ; ((BuildVersion--)); echo "${MajorVersion}.${MinorVersion}.${PatchVersion}-b${BuildVersion}")"
|
||||||
versionKey=""
|
|
||||||
expectedTeamID="P6CDJZR997"
|
expectedTeamID="P6CDJZR997"
|
||||||
|
|
||||||
# Dialog icon
|
# Dialog icon
|
||||||
@@ -51,9 +54,10 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dial
|
|||||||
# INSTALL=force
|
# INSTALL=force
|
||||||
######################################################################
|
######################################################################
|
||||||
# To be used as a script sent out from a MDM.
|
# To be used as a script sent out from a MDM.
|
||||||
# Fill the variable "item" above with a label.
|
# Fill out the label variables above, and those will be included in the Installomator call, circa on line 248
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 10.0.3 : A bit more logging on succes, and change in ending Dialog part.
|
||||||
# v. 10.0.2 : Improved icon checks and failovers
|
# v. 10.0.2 : Improved icon checks and failovers
|
||||||
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
|
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
|
||||||
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
||||||
@@ -66,6 +70,10 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
|||||||
|
|
||||||
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
|
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
|
||||||
|
|
||||||
|
if [[ -z "$item" ]]; then
|
||||||
|
item="$name"
|
||||||
|
fi
|
||||||
|
|
||||||
dialogUpdate() {
|
dialogUpdate() {
|
||||||
# $1: dialog command
|
# $1: dialog command
|
||||||
local dcommand="$1"
|
local dcommand="$1"
|
||||||
@@ -76,24 +84,24 @@ dialogUpdate() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
checkCmdOutput () {
|
checkCmdOutput () {
|
||||||
# $1: cmdOutput
|
local checkOutput="$1"
|
||||||
local cmdOutput="$1"
|
exitStatus="$( echo "${checkOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$checkOutput"
|
||||||
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
|
#errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )"
|
||||||
#echo "$errorOutput"
|
#echo "$errorOutput"
|
||||||
fi
|
fi
|
||||||
|
#echo "$checkOutput"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check the currently logged in user
|
# Check the currently logged in user
|
||||||
currentUser=$(stat -f "%Su" /dev/console)
|
currentUser=$(stat -f "%Su" /dev/console)
|
||||||
if [ -z "$currentUser" ] || [ "$currentUser" = "loginwindow" ] || [ "$currentUser" = "_mbsetupuser" ] || [ "$currentUser" = "root" ]; then
|
if [[ -z "$currentUser" ]] || [[ "$currentUser" = "loginwindow" ]] || [[ "$currentUser" = "_mbsetupuser" ]] || [[ "$currentUser" = "root" ]]; then
|
||||||
echo "ERROR. Logged in user is $currentUser! Cannot proceed."
|
echo "ERROR. Logged in user is $currentUser! Cannot proceed."
|
||||||
exit 97
|
exit 97
|
||||||
fi
|
fi
|
||||||
@@ -123,9 +131,10 @@ caffexit () {
|
|||||||
# Mark: Installation begins
|
# Mark: Installation begins
|
||||||
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
||||||
|
|
||||||
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
|
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion | cut -c1-2) -lt 20 ]]; then
|
||||||
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
|
echo "Skipping swiftDialog UI, using notifications."
|
||||||
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
|
#echo "Installomator should be at least version 10 to support swiftDialog. Installed version $installomatorVersion."
|
||||||
|
#echo "And macOS 11 Big Sur (build 20A) is required for swiftDialog. Installed build $(sw_vers -buildVersion)."
|
||||||
installomatorNotify="NOTIFY=all"
|
installomatorNotify="NOTIFY=all"
|
||||||
else
|
else
|
||||||
installomatorNotify="NOTIFY=silent"
|
installomatorNotify="NOTIFY=silent"
|
||||||
@@ -134,7 +143,7 @@ else
|
|||||||
echo "Cannot find dialog at $dialogApp"
|
echo "Cannot find dialog at $dialogApp"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure and display swiftDialog
|
# Configure and display swiftDialog
|
||||||
@@ -147,24 +156,24 @@ else
|
|||||||
echo "$item $itemName"
|
echo "$item $itemName"
|
||||||
|
|
||||||
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
||||||
echo "icon before check: $icon"
|
#echo "icon before check: $icon"
|
||||||
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
||||||
echo "icon looks to be web-link"
|
#echo "icon looks to be web-link"
|
||||||
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
||||||
echo "ERROR: Cannot download link. Reset icon."
|
echo "ERROR: Cannot download ${icon} link. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
||||||
echo "icon looks to be a file"
|
#echo "icon looks to be a file"
|
||||||
if [[ ! -a "${icon}" ]]; then
|
if [[ ! -a "${icon}" ]]; then
|
||||||
echo "ERROR: Cannot find file. Reset icon."
|
echo "ERROR: Cannot find icon file ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: Cannot figure out icon. Reset icon."
|
echo "ERROR: Cannot figure out icon ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
echo "icon after first check: $icon"
|
#echo "icon after first check: $icon"
|
||||||
# If no icon defined we are trying to search for installed app icon
|
# If no icon defined we are trying to search for installed app icon
|
||||||
if [[ "$icon" == "" ]]; then
|
if [[ "$icon" == "" ]]; then
|
||||||
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
||||||
@@ -173,7 +182,7 @@ else
|
|||||||
appIcon="${appIcon}.icns"
|
appIcon="${appIcon}.icns"
|
||||||
fi
|
fi
|
||||||
icon="${appPath}/Contents/Resources/${appIcon}"
|
icon="${appPath}/Contents/Resources/${appIcon}"
|
||||||
echo "Icon before file check: ${icon}"
|
#echo "Icon before file check: ${icon}"
|
||||||
if [ ! -f "${icon}" ]; then
|
if [ ! -f "${icon}" ]; then
|
||||||
# Using LOGO variable to show logo in swiftDialog
|
# Using LOGO variable to show logo in swiftDialog
|
||||||
case $LOGO in
|
case $LOGO in
|
||||||
@@ -241,7 +250,7 @@ fi
|
|||||||
|
|
||||||
# Install software using Installomator with valuesfromarguments
|
# Install software using Installomator with valuesfromarguments
|
||||||
cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
|
cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
|
||||||
name=${name} \
|
name=\"${name}\" \
|
||||||
type=${type} \
|
type=${type} \
|
||||||
packageID=${packageID} \
|
packageID=${packageID} \
|
||||||
downloadURL=\"$downloadURL\" \
|
downloadURL=\"$downloadURL\" \
|
||||||
@@ -250,7 +259,7 @@ cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
|
|||||||
expectedTeamID=${expectedTeamID} \
|
expectedTeamID=${expectedTeamID} \
|
||||||
${installomatorOptions} ${installomatorNotify} || true)"
|
${installomatorOptions} ${installomatorNotify} || true)"
|
||||||
|
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
|
|
||||||
# Mark: dockutil stuff
|
# Mark: dockutil stuff
|
||||||
if [[ $addToDock -eq 1 ]]; then
|
if [[ $addToDock -eq 1 ]]; then
|
||||||
@@ -259,7 +268,7 @@ if [[ $addToDock -eq 1 ]]; then
|
|||||||
echo "Cannot find dockutil at $dockutil, trying installation"
|
echo "Cannot find dockutil at $dockutil, trying installation"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
echo "Adding to Dock"
|
echo "Adding to Dock"
|
||||||
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
||||||
@@ -269,9 +278,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Mark: Ending
|
# Mark: Ending
|
||||||
if [[ $installomatorVersion -lt 10 ]]; then
|
if [[ $installomatorVersion -ge 10 && $(sw_vers -buildVersion | cut -c1-2) -ge 20 ]]; then
|
||||||
echo "Again skipping Dialog stuff."
|
|
||||||
else
|
|
||||||
# close and quit dialog
|
# close and quit dialog
|
||||||
dialogUpdate "progress: complete"
|
dialogUpdate "progress: complete"
|
||||||
dialogUpdate "progresstext: Done"
|
dialogUpdate "progresstext: Done"
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit DIALOG_CMD_FIL
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 10.0.3 : A bit more logging on succes, and change in ending Dialog part.
|
||||||
# v. 10.0.2 : Improved icon checks and failovers
|
# v. 10.0.2 : Improved icon checks and failovers
|
||||||
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
|
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
|
||||||
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
||||||
@@ -67,19 +68,19 @@ dialogUpdate() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
checkCmdOutput () {
|
checkCmdOutput () {
|
||||||
# $1: cmdOutput
|
local checkOutput="$1"
|
||||||
local cmdOutput="$1"
|
exitStatus="$( echo "${checkOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$checkOutput"
|
||||||
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
|
#errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )"
|
||||||
#echo "$errorOutput"
|
#echo "$errorOutput"
|
||||||
fi
|
fi
|
||||||
|
#echo "$checkOutput"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check the currently logged in user
|
# Check the currently logged in user
|
||||||
@@ -114,9 +115,10 @@ caffexit () {
|
|||||||
# Mark: Installation begins
|
# Mark: Installation begins
|
||||||
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
||||||
|
|
||||||
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
|
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion | cut -c1-2) -lt 20 ]]; then
|
||||||
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
|
echo "Skipping swiftDialog UI, using notifications."
|
||||||
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
|
#echo "Installomator should be at least version 10 to support swiftDialog. Installed version $installomatorVersion."
|
||||||
|
#echo "And macOS 11 Big Sur (build 20A) is required for swiftDialog. Installed build $(sw_vers -buildVersion)."
|
||||||
installomatorNotify="NOTIFY=all"
|
installomatorNotify="NOTIFY=all"
|
||||||
else
|
else
|
||||||
installomatorNotify="NOTIFY=silent"
|
installomatorNotify="NOTIFY=silent"
|
||||||
@@ -125,7 +127,7 @@ else
|
|||||||
echo "Cannot find dialog at $dialogApp"
|
echo "Cannot find dialog at $dialogApp"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure and display swiftDialog
|
# Configure and display swiftDialog
|
||||||
@@ -138,24 +140,24 @@ else
|
|||||||
echo "$item $itemName"
|
echo "$item $itemName"
|
||||||
|
|
||||||
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
||||||
echo "icon before check: $icon"
|
#echo "icon before check: $icon"
|
||||||
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
||||||
echo "icon looks to be web-link"
|
#echo "icon looks to be web-link"
|
||||||
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
||||||
echo "ERROR: Cannot download link. Reset icon."
|
echo "ERROR: Cannot download ${icon} link. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
||||||
echo "icon looks to be a file"
|
#echo "icon looks to be a file"
|
||||||
if [[ ! -a "${icon}" ]]; then
|
if [[ ! -a "${icon}" ]]; then
|
||||||
echo "ERROR: Cannot find file. Reset icon."
|
echo "ERROR: Cannot find icon file ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: Cannot figure out icon. Reset icon."
|
echo "ERROR: Cannot figure out icon ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
echo "icon after first check: $icon"
|
#echo "icon after first check: $icon"
|
||||||
# If no icon defined we are trying to search for installed app icon
|
# If no icon defined we are trying to search for installed app icon
|
||||||
if [[ "$icon" == "" ]]; then
|
if [[ "$icon" == "" ]]; then
|
||||||
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
||||||
@@ -164,7 +166,7 @@ else
|
|||||||
appIcon="${appIcon}.icns"
|
appIcon="${appIcon}.icns"
|
||||||
fi
|
fi
|
||||||
icon="${appPath}/Contents/Resources/${appIcon}"
|
icon="${appPath}/Contents/Resources/${appIcon}"
|
||||||
echo "Icon before file check: ${icon}"
|
#echo "Icon before file check: ${icon}"
|
||||||
if [ ! -f "${icon}" ]; then
|
if [ ! -f "${icon}" ]; then
|
||||||
# Using LOGO variable to show logo in swiftDialog
|
# Using LOGO variable to show logo in swiftDialog
|
||||||
case $LOGO in
|
case $LOGO in
|
||||||
@@ -232,7 +234,7 @@ fi
|
|||||||
|
|
||||||
# Install software using Installomator
|
# Install software using Installomator
|
||||||
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
|
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
|
|
||||||
# Mark: dockutil stuff
|
# Mark: dockutil stuff
|
||||||
if [[ $addToDock -eq 1 ]]; then
|
if [[ $addToDock -eq 1 ]]; then
|
||||||
@@ -241,7 +243,7 @@ if [[ $addToDock -eq 1 ]]; then
|
|||||||
echo "Cannot find dockutil at $dockutil, trying installation"
|
echo "Cannot find dockutil at $dockutil, trying installation"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
echo "Adding to Dock"
|
echo "Adding to Dock"
|
||||||
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
||||||
@@ -251,9 +253,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Mark: Ending
|
# Mark: Ending
|
||||||
if [[ $installomatorVersion -lt 10 ]]; then
|
if [[ $installomatorVersion -ge 10 && $(sw_vers -buildVersion | cut -c1-2) -ge 20 ]]; then
|
||||||
echo "Again skipping Dialog stuff."
|
|
||||||
else
|
|
||||||
# close and quit dialog
|
# close and quit dialog
|
||||||
dialogUpdate "progress: complete"
|
dialogUpdate "progress: complete"
|
||||||
dialogUpdate "progresstext: Done"
|
dialogUpdate "progresstext: Done"
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dial
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 10.0.3 : A bit more logging on succes, and change in ending Dialog part.
|
||||||
# v. 10.0.2 : Improved icon checks and failovers
|
# v. 10.0.2 : Improved icon checks and failovers
|
||||||
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
|
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
|
||||||
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
||||||
@@ -67,19 +68,19 @@ dialogUpdate() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
checkCmdOutput () {
|
checkCmdOutput () {
|
||||||
# $1: cmdOutput
|
local checkOutput="$1"
|
||||||
local cmdOutput="$1"
|
exitStatus="$( echo "${checkOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$checkOutput"
|
||||||
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
|
#errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )"
|
||||||
#echo "$errorOutput"
|
#echo "$errorOutput"
|
||||||
fi
|
fi
|
||||||
|
#echo "$checkOutput"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check the currently logged in user
|
# Check the currently logged in user
|
||||||
@@ -114,9 +115,10 @@ caffexit () {
|
|||||||
# Mark: Installation begins
|
# Mark: Installation begins
|
||||||
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
||||||
|
|
||||||
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
|
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion | cut -c1-2) -lt 20 ]]; then
|
||||||
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
|
echo "Skipping swiftDialog UI, using notifications."
|
||||||
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
|
#echo "Installomator should be at least version 10 to support swiftDialog. Installed version $installomatorVersion."
|
||||||
|
#echo "And macOS 11 Big Sur (build 20A) is required for swiftDialog. Installed build $(sw_vers -buildVersion)."
|
||||||
installomatorNotify="NOTIFY=all"
|
installomatorNotify="NOTIFY=all"
|
||||||
else
|
else
|
||||||
installomatorNotify="NOTIFY=silent"
|
installomatorNotify="NOTIFY=silent"
|
||||||
@@ -125,7 +127,7 @@ else
|
|||||||
echo "Cannot find dialog at $dialogApp"
|
echo "Cannot find dialog at $dialogApp"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure and display swiftDialog
|
# Configure and display swiftDialog
|
||||||
@@ -138,24 +140,24 @@ else
|
|||||||
echo "$item $itemName"
|
echo "$item $itemName"
|
||||||
|
|
||||||
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
||||||
echo "icon before check: $icon"
|
#echo "icon before check: $icon"
|
||||||
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
||||||
echo "icon looks to be web-link"
|
#echo "icon looks to be web-link"
|
||||||
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
||||||
echo "ERROR: Cannot download link. Reset icon."
|
echo "ERROR: Cannot download ${icon} link. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
||||||
echo "icon looks to be a file"
|
#echo "icon looks to be a file"
|
||||||
if [[ ! -a "${icon}" ]]; then
|
if [[ ! -a "${icon}" ]]; then
|
||||||
echo "ERROR: Cannot find file. Reset icon."
|
echo "ERROR: Cannot find icon file ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: Cannot figure out icon. Reset icon."
|
echo "ERROR: Cannot figure out icon ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
echo "icon after first check: $icon"
|
#echo "icon after first check: $icon"
|
||||||
# If no icon defined we are trying to search for installed app icon
|
# If no icon defined we are trying to search for installed app icon
|
||||||
if [[ "$icon" == "" ]]; then
|
if [[ "$icon" == "" ]]; then
|
||||||
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
||||||
@@ -164,7 +166,7 @@ else
|
|||||||
appIcon="${appIcon}.icns"
|
appIcon="${appIcon}.icns"
|
||||||
fi
|
fi
|
||||||
icon="${appPath}/Contents/Resources/${appIcon}"
|
icon="${appPath}/Contents/Resources/${appIcon}"
|
||||||
echo "Icon before file check: ${icon}"
|
#echo "Icon before file check: ${icon}"
|
||||||
if [ ! -f "${icon}" ]; then
|
if [ ! -f "${icon}" ]; then
|
||||||
# Using LOGO variable to show logo in swiftDialog
|
# Using LOGO variable to show logo in swiftDialog
|
||||||
case $LOGO in
|
case $LOGO in
|
||||||
@@ -232,7 +234,7 @@ fi
|
|||||||
|
|
||||||
# Install software using Installomator
|
# Install software using Installomator
|
||||||
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
|
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
|
|
||||||
# Mark: dockutil stuff
|
# Mark: dockutil stuff
|
||||||
if [[ $addToDock -eq 1 ]]; then
|
if [[ $addToDock -eq 1 ]]; then
|
||||||
@@ -241,7 +243,7 @@ if [[ $addToDock -eq 1 ]]; then
|
|||||||
echo "Cannot find dockutil at $dockutil, trying installation"
|
echo "Cannot find dockutil at $dockutil, trying installation"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
echo "Adding to Dock"
|
echo "Adding to Dock"
|
||||||
for appPath in "${appPaths[@]}"; do
|
for appPath in "${appPaths[@]}"; do
|
||||||
@@ -254,9 +256,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Mark: Ending
|
# Mark: Ending
|
||||||
if [[ $installomatorVersion -lt 10 ]]; then
|
iif [[ $installomatorVersion -ge 10 && $(sw_vers -buildVersion | cut -c1-2) -ge 20 ]]; then
|
||||||
echo "Again skipping Dialog stuff."
|
|
||||||
else
|
|
||||||
# close and quit dialog
|
# close and quit dialog
|
||||||
dialogUpdate "progress: complete"
|
dialogUpdate "progress: complete"
|
||||||
dialogUpdate "progresstext: Done"
|
dialogUpdate "progresstext: Done"
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dial
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 10.0.3 : A bit more logging on succes, and change in ending Dialog part.
|
||||||
# v. 10.0.2 : Improved icon checks and failovers
|
# v. 10.0.2 : Improved icon checks and failovers
|
||||||
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
|
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
|
||||||
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
||||||
@@ -64,19 +65,19 @@ dialogUpdate() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
checkCmdOutput () {
|
checkCmdOutput () {
|
||||||
# $1: cmdOutput
|
local checkOutput="$1"
|
||||||
local cmdOutput="$1"
|
exitStatus="$( echo "${checkOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$checkOutput"
|
||||||
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
|
#errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )"
|
||||||
#echo "$errorOutput"
|
#echo "$errorOutput"
|
||||||
fi
|
fi
|
||||||
|
#echo "$checkOutput"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check the currently logged in user
|
# Check the currently logged in user
|
||||||
@@ -111,9 +112,10 @@ caffexit () {
|
|||||||
# Mark: Installation begins
|
# Mark: Installation begins
|
||||||
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
||||||
|
|
||||||
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
|
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion | cut -c1-2) -lt 20 ]]; then
|
||||||
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
|
echo "Skipping swiftDialog UI, using notifications."
|
||||||
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
|
#echo "Installomator should be at least version 10 to support swiftDialog. Installed version $installomatorVersion."
|
||||||
|
#echo "And macOS 11 Big Sur (build 20A) is required for swiftDialog. Installed build $(sw_vers -buildVersion)."
|
||||||
installomatorNotify="NOTIFY=all"
|
installomatorNotify="NOTIFY=all"
|
||||||
else
|
else
|
||||||
installomatorNotify="NOTIFY=silent"
|
installomatorNotify="NOTIFY=silent"
|
||||||
@@ -122,7 +124,7 @@ else
|
|||||||
echo "Cannot find dialog at $dialogApp"
|
echo "Cannot find dialog at $dialogApp"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure and display swiftDialog
|
# Configure and display swiftDialog
|
||||||
@@ -135,24 +137,24 @@ else
|
|||||||
echo "$item $itemName"
|
echo "$item $itemName"
|
||||||
|
|
||||||
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
||||||
echo "icon before check: $icon"
|
#echo "icon before check: $icon"
|
||||||
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
||||||
echo "icon looks to be web-link"
|
#echo "icon looks to be web-link"
|
||||||
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
||||||
echo "ERROR: Cannot download link. Reset icon."
|
echo "ERROR: Cannot download ${icon} link. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
||||||
echo "icon looks to be a file"
|
#echo "icon looks to be a file"
|
||||||
if [[ ! -a "${icon}" ]]; then
|
if [[ ! -a "${icon}" ]]; then
|
||||||
echo "ERROR: Cannot find file. Reset icon."
|
echo "ERROR: Cannot find icon file ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: Cannot figure out icon. Reset icon."
|
echo "ERROR: Cannot figure out icon ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
echo "icon after first check: $icon"
|
#echo "icon after first check: $icon"
|
||||||
# If no icon defined we are trying to search for installed app icon
|
# If no icon defined we are trying to search for installed app icon
|
||||||
if [[ "$icon" == "" ]]; then
|
if [[ "$icon" == "" ]]; then
|
||||||
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
||||||
@@ -161,7 +163,7 @@ else
|
|||||||
appIcon="${appIcon}.icns"
|
appIcon="${appIcon}.icns"
|
||||||
fi
|
fi
|
||||||
icon="${appPath}/Contents/Resources/${appIcon}"
|
icon="${appPath}/Contents/Resources/${appIcon}"
|
||||||
echo "Icon before file check: ${icon}"
|
#echo "Icon before file check: ${icon}"
|
||||||
if [ ! -f "${icon}" ]; then
|
if [ ! -f "${icon}" ]; then
|
||||||
# Using LOGO variable to show logo in swiftDialog
|
# Using LOGO variable to show logo in swiftDialog
|
||||||
case $LOGO in
|
case $LOGO in
|
||||||
@@ -229,7 +231,7 @@ fi
|
|||||||
|
|
||||||
# Install software using Installomator
|
# Install software using Installomator
|
||||||
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
|
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
|
|
||||||
# Mark: dockutil stuff
|
# Mark: dockutil stuff
|
||||||
if [[ $addToDock -eq 1 ]]; then
|
if [[ $addToDock -eq 1 ]]; then
|
||||||
@@ -238,7 +240,7 @@ if [[ $addToDock -eq 1 ]]; then
|
|||||||
echo "Cannot find dockutil at $dockutil, trying installation"
|
echo "Cannot find dockutil at $dockutil, trying installation"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
echo "Adding to Dock"
|
echo "Adding to Dock"
|
||||||
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
||||||
@@ -248,9 +250,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Mark: Ending
|
# Mark: Ending
|
||||||
if [[ $installomatorVersion -lt 10 ]]; then
|
if [[ $installomatorVersion -ge 10 && $(sw_vers -buildVersion | cut -c1-2) -ge 20 ]]; then
|
||||||
echo "Again skipping Dialog stuff."
|
|
||||||
else
|
|
||||||
# close and quit dialog
|
# close and quit dialog
|
||||||
dialogUpdate "progress: complete"
|
dialogUpdate "progress: complete"
|
||||||
dialogUpdate "progresstext: Done"
|
dialogUpdate "progresstext: Done"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ dialog_command_file="/var/tmp/dialog.log"
|
|||||||
dialogApp="/Library/Application Support/Dialog/Dialog.app"
|
dialogApp="/Library/Application Support/Dialog/Dialog.app"
|
||||||
dockutil="/usr/local/bin/dockutil"
|
dockutil="/usr/local/bin/dockutil"
|
||||||
|
|
||||||
installomatorOptions="BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space
|
installomatorOptions="BLOCKING_PROCESS_ACTION=ignore DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space
|
||||||
|
|
||||||
# Other installomatorOptions:
|
# Other installomatorOptions:
|
||||||
# LOGGING=REQ
|
# LOGGING=REQ
|
||||||
@@ -45,6 +45,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent DIALOG_CMD_FI
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 10.0.3 : A bit more logging on succes, and change in ending Dialog part.
|
||||||
# v. 10.0.2 : Improved icon checks and failovers
|
# v. 10.0.2 : Improved icon checks and failovers
|
||||||
# v. 10.0.1 : Can add the app to Dock using dockutil
|
# v. 10.0.1 : Can add the app to Dock using dockutil
|
||||||
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
# v. 10.0 : Integration with Dialog and Installomator v. 10
|
||||||
@@ -67,19 +68,19 @@ dialogUpdate() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
checkCmdOutput () {
|
checkCmdOutput () {
|
||||||
# $1: cmdOutput
|
local checkOutput="$1"
|
||||||
local cmdOutput="$1"
|
exitStatus="$( echo "${checkOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${checkOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$checkOutput"
|
||||||
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
|
#errorOutput="$( echo "${checkOutput}" | grep --binary-files=text -i "error" || true )"
|
||||||
#echo "$errorOutput"
|
#echo "$errorOutput"
|
||||||
fi
|
fi
|
||||||
|
#echo "$checkOutput"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check the currently logged in user
|
# Check the currently logged in user
|
||||||
@@ -114,9 +115,10 @@ caffexit () {
|
|||||||
# Mark: Installation begins
|
# Mark: Installation begins
|
||||||
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
|
||||||
|
|
||||||
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
|
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion | cut -c1-2) -lt 20 ]]; then
|
||||||
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
|
echo "Skipping swiftDialog UI, using notifications."
|
||||||
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
|
#echo "Installomator should be at least version 10 to support swiftDialog. Installed version $installomatorVersion."
|
||||||
|
#echo "And macOS 11 Big Sur (build 20A) is required for swiftDialog. Installed build $(sw_vers -buildVersion)."
|
||||||
installomatorNotify="NOTIFY=all"
|
installomatorNotify="NOTIFY=all"
|
||||||
else
|
else
|
||||||
installomatorNotify="NOTIFY=silent"
|
installomatorNotify="NOTIFY=silent"
|
||||||
@@ -125,7 +127,7 @@ else
|
|||||||
echo "Cannot find dialog at $dialogApp"
|
echo "Cannot find dialog at $dialogApp"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure and display swiftDialog
|
# Configure and display swiftDialog
|
||||||
@@ -138,24 +140,24 @@ else
|
|||||||
echo "$item $itemName"
|
echo "$item $itemName"
|
||||||
|
|
||||||
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
|
||||||
echo "icon before check: $icon"
|
#echo "icon before check: $icon"
|
||||||
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
|
||||||
echo "icon looks to be web-link"
|
#echo "icon looks to be web-link"
|
||||||
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
|
||||||
echo "ERROR: Cannot download link. Reset icon."
|
echo "ERROR: Cannot download ${icon} link. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
|
||||||
echo "icon looks to be a file"
|
#echo "icon looks to be a file"
|
||||||
if [[ ! -a "${icon}" ]]; then
|
if [[ ! -a "${icon}" ]]; then
|
||||||
echo "ERROR: Cannot find file. Reset icon."
|
echo "ERROR: Cannot find icon file ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: Cannot figure out icon. Reset icon."
|
echo "ERROR: Cannot figure out icon ${icon}. Reset icon."
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
echo "icon after first check: $icon"
|
#echo "icon after first check: $icon"
|
||||||
# If no icon defined we are trying to search for installed app icon
|
# If no icon defined we are trying to search for installed app icon
|
||||||
if [[ "$icon" == "" ]]; then
|
if [[ "$icon" == "" ]]; then
|
||||||
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
|
||||||
@@ -164,7 +166,7 @@ else
|
|||||||
appIcon="${appIcon}.icns"
|
appIcon="${appIcon}.icns"
|
||||||
fi
|
fi
|
||||||
icon="${appPath}/Contents/Resources/${appIcon}"
|
icon="${appPath}/Contents/Resources/${appIcon}"
|
||||||
echo "Icon before file check: ${icon}"
|
#echo "Icon before file check: ${icon}"
|
||||||
if [ ! -f "${icon}" ]; then
|
if [ ! -f "${icon}" ]; then
|
||||||
# Using LOGO variable to show logo in swiftDialog
|
# Using LOGO variable to show logo in swiftDialog
|
||||||
case $LOGO in
|
case $LOGO in
|
||||||
@@ -232,7 +234,7 @@ fi
|
|||||||
|
|
||||||
# Install software using Installomator
|
# Install software using Installomator
|
||||||
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
|
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
|
|
||||||
# Mark: dockutil stuff
|
# Mark: dockutil stuff
|
||||||
if [[ $addToDock -eq 1 ]]; then
|
if [[ $addToDock -eq 1 ]]; then
|
||||||
@@ -241,7 +243,7 @@ if [[ $addToDock -eq 1 ]]; then
|
|||||||
echo "Cannot find dockutil at $dockutil, trying installation"
|
echo "Cannot find dockutil at $dockutil, trying installation"
|
||||||
# Install using Installlomator
|
# Install using Installlomator
|
||||||
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
|
||||||
checkCmdOutput $cmdOutput
|
checkCmdOutput "${cmdOutput}"
|
||||||
fi
|
fi
|
||||||
echo "Adding to Dock"
|
echo "Adding to Dock"
|
||||||
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
|
||||||
@@ -251,9 +253,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Mark: Ending
|
# Mark: Ending
|
||||||
if [[ $installomatorVersion -lt 10 ]]; then
|
if [[ $installomatorVersion -ge 10 && $(sw_vers -buildVersion | cut -c1-2) -ge 20 ]]; then
|
||||||
echo "Again skipping Dialog stuff."
|
|
||||||
else
|
|
||||||
# close and quit dialog
|
# close and quit dialog
|
||||||
dialogUpdate "progress: complete"
|
dialogUpdate "progress: complete"
|
||||||
dialogUpdate "progresstext: Done"
|
dialogUpdate "progresstext: Done"
|
||||||
|
|||||||
@@ -5,10 +5,14 @@
|
|||||||
|
|
||||||
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
|
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
|
||||||
|
|
||||||
#item="" # enter the software to install (if it has a label in future version of Installomator)
|
# Have the label been submittet in a PR for Installomator?
|
||||||
|
# What version of Installomator is it expected to be included in?
|
||||||
|
# Version 10
|
||||||
|
|
||||||
|
item="" # enter the software to install (if it has a label in future version of Installomator)
|
||||||
|
|
||||||
# Variables for label
|
# Variables for label
|
||||||
name="ClickShare"
|
name="ClickShare" # Spaces in the name will not work
|
||||||
type="appInDmgInZip"
|
type="appInDmgInZip"
|
||||||
packageID=""
|
packageID=""
|
||||||
downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )"
|
downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )"
|
||||||
@@ -40,6 +44,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user LOGGING=INFO NOTIFY=al
|
|||||||
# Fill the variable "what" above with a label.
|
# Fill the variable "what" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 9.2.2 : A bit more logging on succes.
|
||||||
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -84,8 +89,8 @@ cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
|
|||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${what} succesfully installed."
|
echo "${what} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${what}. Exit code ${exitStatus}"
|
echo "ERROR installing ${what}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$cmdOutput"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit" # Separated b
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 9.2.2 : A bit more logging on succes.
|
||||||
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -65,8 +66,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
|
|||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$cmdOutput"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit NOTIFY=all" #
|
|||||||
# Fill the variable "what" above with a label.
|
# Fill the variable "what" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 9.2.2 : A bit more logging on succes.
|
||||||
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -65,8 +66,8 @@ cmdOutput="$(${destFile} ${what} LOGO=$LOGO ${installomatorOptions} || true)"
|
|||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${what} succesfully installed."
|
echo "${what} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${what}. Exit code ${exitStatus}"
|
echo "ERROR installing ${what}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$cmdOutput"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user" # Separated by space
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 9.2.2 : A bit more logging on succes.
|
||||||
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -65,8 +66,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
|
|||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$cmdOutput"
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user NOTIFY=all" # Separate
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 9.2.2 : A bit more logging on succes.
|
||||||
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -66,8 +67,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
|
|||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$cmdOutput"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent" # Separated
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 9.2.2 : A bit more logging on succes.
|
||||||
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -65,8 +66,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
|
|||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$cmdOutput"
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit" # Separated b
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 9.2.2 : A bit more logging on succes.
|
||||||
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -77,8 +78,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
|
|||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$cmdOutput"
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user" # Separated by space
|
|||||||
# Fill the variable "item" above with a label.
|
# Fill the variable "item" above with a label.
|
||||||
# Script will run this label through Installomator.
|
# Script will run this label through Installomator.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
# v. 9.2.2 : A bit more logging on succes.
|
||||||
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
@@ -77,8 +78,8 @@ cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
|
|||||||
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
|
||||||
if [[ ${exitStatus} -eq 0 ]] ; then
|
if [[ ${exitStatus} -eq 0 ]] ; then
|
||||||
echo "${item} succesfully installed."
|
echo "${item} succesfully installed."
|
||||||
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
|
selectedOutput="$( echo "${cmdOutput}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)" || true )"
|
||||||
echo "$warnOutput"
|
echo "$selectedOutput"
|
||||||
else
|
else
|
||||||
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
echo "ERROR installing ${item}. Exit code ${exitStatus}"
|
||||||
echo "$cmdOutput"
|
echo "$cmdOutput"
|
||||||
|
|||||||
19
MDM/Collect Installomator.log.sh
Normal file
19
MDM/Collect Installomator.log.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# A small script to grab Installomator log from a client Mac.
|
||||||
|
# Can be sent to the client so the result can be seen in MDM
|
||||||
|
# Only uncomment the line below for the things you want to see.
|
||||||
|
|
||||||
|
logFile="/var/log/Installomator.log"
|
||||||
|
|
||||||
|
# Show latest 100 lines of the log
|
||||||
|
tail -100 "${logFile}"
|
||||||
|
|
||||||
|
# Show latest 500 lines but filter to REQ|ERROR|WARN lines
|
||||||
|
# Great overview of the log
|
||||||
|
#tail -500 "${logFile}" | grep --binary-files=text -E ": (REQ|ERROR|WARN)"
|
||||||
|
|
||||||
|
# Show only one label
|
||||||
|
# Great to see everything for a label that might fail or not working as expected
|
||||||
|
label="valuesfromarguments"
|
||||||
|
#cat "${logFile}" | grep --binary-files=text ": ${label}"
|
||||||
@@ -54,7 +54,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT."
|
|||||||
# https://github.com/Installomator/Installomator
|
# https://github.com/Installomator/Installomator
|
||||||
#
|
#
|
||||||
######################################################################
|
######################################################################
|
||||||
scriptVersion="9.5"
|
scriptVersion="9.6"
|
||||||
|
# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails.
|
||||||
# v. 9.5 : 2022-09-21 : change of GitHub download
|
# v. 9.5 : 2022-09-21 : change of GitHub download
|
||||||
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
|
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
|
||||||
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
|
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
|
||||||
@@ -207,11 +208,11 @@ gitusername="Installomator"
|
|||||||
gitreponame="Installomator"
|
gitreponame="Installomator"
|
||||||
#printlog "$gitusername $gitreponame"
|
#printlog "$gitusername $gitreponame"
|
||||||
filetype="pkg"
|
filetype="pkg"
|
||||||
|
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||||
|
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
||||||
|
printlog "GitHub API failed, trying failover."
|
||||||
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
|
||||||
printlog "Trying GitHub API for download URL."
|
|
||||||
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
|
||||||
fi
|
fi
|
||||||
#printlog "$downloadURL"
|
#printlog "$downloadURL"
|
||||||
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT."
|
|||||||
# https://github.com/Installomator/Installomator
|
# https://github.com/Installomator/Installomator
|
||||||
#
|
#
|
||||||
######################################################################
|
######################################################################
|
||||||
scriptVersion="9.5"
|
scriptVersion="9.6"
|
||||||
|
# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails.
|
||||||
# v. 9.5 : 2022-09-21 : change of GitHub download
|
# v. 9.5 : 2022-09-21 : change of GitHub download
|
||||||
# v. 9.4 : 2022-09-14 : Making error message optional. downloadURL can fall back on GitHub API.
|
# v. 9.4 : 2022-09-14 : Making error message optional. downloadURL can fall back on GitHub API.
|
||||||
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
|
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
|
||||||
@@ -178,11 +179,11 @@ gitusername="Installomator"
|
|||||||
gitreponame="Installomator"
|
gitreponame="Installomator"
|
||||||
#printlog "$gitusername $gitreponame"
|
#printlog "$gitusername $gitreponame"
|
||||||
filetype="pkg"
|
filetype="pkg"
|
||||||
|
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||||
|
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
||||||
|
printlog "GitHub API failed, trying failover."
|
||||||
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
|
||||||
printlog "Trying GitHub API for download URL."
|
|
||||||
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
|
||||||
fi
|
fi
|
||||||
#printlog "$downloadURL"
|
#printlog "$downloadURL"
|
||||||
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT."
|
|||||||
# https://github.com/Installomator/Installomator
|
# https://github.com/Installomator/Installomator
|
||||||
#
|
#
|
||||||
######################################################################
|
######################################################################
|
||||||
scriptVersion="9.5"
|
scriptVersion="9.6"
|
||||||
|
# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails.
|
||||||
# v. 9.5 : 2022-09-21 : change of GitHub download
|
# v. 9.5 : 2022-09-21 : change of GitHub download
|
||||||
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
|
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
|
||||||
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
|
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
|
||||||
@@ -207,11 +208,11 @@ gitusername="Installomator"
|
|||||||
gitreponame="Installomator"
|
gitreponame="Installomator"
|
||||||
#printlog "$gitusername $gitreponame"
|
#printlog "$gitusername $gitreponame"
|
||||||
filetype="pkg"
|
filetype="pkg"
|
||||||
|
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||||
|
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
||||||
|
printlog "GitHub API failed, trying failover."
|
||||||
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
|
||||||
printlog "Trying GitHub API for download URL."
|
|
||||||
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
|
||||||
fi
|
fi
|
||||||
#printlog "$downloadURL"
|
#printlog "$downloadURL"
|
||||||
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT."
|
|||||||
# https://github.com/Installomator/Installomator
|
# https://github.com/Installomator/Installomator
|
||||||
#
|
#
|
||||||
######################################################################
|
######################################################################
|
||||||
scriptVersion="9.5"
|
scriptVersion="9.6"
|
||||||
|
# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails.
|
||||||
# v. 9.5 : 2022-09-21 : change of GitHub download
|
# v. 9.5 : 2022-09-21 : change of GitHub download
|
||||||
# v. 9.4 : 2022-09-14 : Making error message optional. downloadURL can fall back on GitHub API.
|
# v. 9.4 : 2022-09-14 : Making error message optional. downloadURL can fall back on GitHub API.
|
||||||
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
|
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
|
||||||
@@ -177,11 +178,11 @@ gitusername="Installomator"
|
|||||||
gitreponame="Installomator"
|
gitreponame="Installomator"
|
||||||
#printlog "$gitusername $gitreponame"
|
#printlog "$gitusername $gitreponame"
|
||||||
filetype="pkg"
|
filetype="pkg"
|
||||||
|
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||||
|
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
||||||
|
printlog "GitHub API failed, trying failover."
|
||||||
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
|
||||||
printlog "Trying GitHub API for download URL."
|
|
||||||
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
|
||||||
fi
|
fi
|
||||||
#printlog "$downloadURL"
|
#printlog "$downloadURL"
|
||||||
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ gitusername="bartreardon"
|
|||||||
gitreponame="swiftDialog"
|
gitreponame="swiftDialog"
|
||||||
#echo "$gitusername $gitreponame"
|
#echo "$gitusername $gitreponame"
|
||||||
filetype="pkg"
|
filetype="pkg"
|
||||||
|
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||||
|
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
||||||
|
printlog "GitHub API failed, trying failover."
|
||||||
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
|
||||||
echo "Trying GitHub API for download URL."
|
|
||||||
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
|
||||||
fi
|
fi
|
||||||
#echo "$downloadURL"
|
#echo "$downloadURL"
|
||||||
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ errorMessage="A problem was encountered setting up this Mac. Please contact IT."
|
|||||||
# Or fonts, like:
|
# Or fonts, like:
|
||||||
# "Apple SF Pro Font,/Library/Fonts/SF-Pro.ttf"
|
# "Apple SF Pro Font,/Library/Fonts/SF-Pro.ttf"
|
||||||
######################################################################
|
######################################################################
|
||||||
scriptVersion="9.5"
|
scriptVersion="9.6"
|
||||||
|
# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails.
|
||||||
# v. 9.5 : 2022-09-21 : change of GitHub download
|
# v. 9.5 : 2022-09-21 : change of GitHub download
|
||||||
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
|
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
|
||||||
# v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling.
|
# v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling.
|
||||||
@@ -230,11 +231,11 @@ gitusername="bartreardon"
|
|||||||
gitreponame="swiftDialog"
|
gitreponame="swiftDialog"
|
||||||
#printlog "$gitusername $gitreponame"
|
#printlog "$gitusername $gitreponame"
|
||||||
filetype="pkg"
|
filetype="pkg"
|
||||||
|
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||||
|
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
||||||
|
printlog "GitHub API failed, trying failover."
|
||||||
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
|
||||||
printlog "Trying GitHub API for download URL."
|
|
||||||
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
|
||||||
fi
|
fi
|
||||||
#printlog "$downloadURL"
|
#printlog "$downloadURL"
|
||||||
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
||||||
@@ -245,6 +246,7 @@ versionKey="CFBundleShortVersionString" #CFBundleVersion
|
|||||||
|
|
||||||
currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)"
|
currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)"
|
||||||
printlog "${name} version: $currentInstalledVersion"
|
printlog "${name} version: $currentInstalledVersion"
|
||||||
|
destFile="/usr/local/bin/dialog"
|
||||||
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
|
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
|
||||||
printlog "$name not found or version not latest."
|
printlog "$name not found or version not latest."
|
||||||
printlog "${destFile}"
|
printlog "${destFile}"
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
# https://github.com/Installomator/Installomator
|
# https://github.com/Installomator/Installomator
|
||||||
#
|
#
|
||||||
######################################################################
|
######################################################################
|
||||||
scriptVersion="9.5"
|
scriptVersion="9.6"
|
||||||
|
# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails.
|
||||||
# v. 9.5 : 2022-09-21 : change of GitHub download
|
# v. 9.5 : 2022-09-21 : change of GitHub download
|
||||||
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
|
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
|
||||||
# v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling.
|
# v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling.
|
||||||
@@ -65,11 +66,11 @@ gitusername="Installomator"
|
|||||||
gitreponame="Installomator"
|
gitreponame="Installomator"
|
||||||
#printlog "$gitusername $gitreponame"
|
#printlog "$gitusername $gitreponame"
|
||||||
filetype="pkg"
|
filetype="pkg"
|
||||||
|
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||||
|
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
||||||
|
printlog "GitHub API failed, trying failover."
|
||||||
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
|
||||||
printlog "Trying GitHub API for download URL."
|
|
||||||
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
|
||||||
fi
|
fi
|
||||||
#printlog "$downloadURL"
|
#printlog "$downloadURL"
|
||||||
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
# https://github.com/Installomator/Installomator
|
# https://github.com/Installomator/Installomator
|
||||||
#
|
#
|
||||||
######################################################################
|
######################################################################
|
||||||
scriptVersion="9.5"
|
scriptVersion="9.6"
|
||||||
|
# v. 9.6 : 2022-11-15 : GitHub API call is first, only try alternative if that fails.
|
||||||
# v. 9.5 : 2022-09-21 : change of GitHub download
|
# v. 9.5 : 2022-09-21 : change of GitHub download
|
||||||
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API.
|
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API.
|
||||||
# v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling.
|
# v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling.
|
||||||
@@ -65,11 +66,11 @@ gitusername="bartreardon"
|
|||||||
gitreponame="swiftDialog"
|
gitreponame="swiftDialog"
|
||||||
#printlog "$gitusername $gitreponame"
|
#printlog "$gitusername $gitreponame"
|
||||||
filetype="pkg"
|
filetype="pkg"
|
||||||
|
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||||
|
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
||||||
|
printlog "GitHub API failed, trying failover."
|
||||||
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
|
||||||
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
|
|
||||||
printlog "Trying GitHub API for download URL."
|
|
||||||
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
|
||||||
fi
|
fi
|
||||||
#printlog "$downloadURL"
|
#printlog "$downloadURL"
|
||||||
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
|
||||||
@@ -80,6 +81,7 @@ versionKey="CFBundleShortVersionString" #CFBundleVersion
|
|||||||
|
|
||||||
currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)"
|
currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)"
|
||||||
printlog "${name} version: $currentInstalledVersion"
|
printlog "${name} version: $currentInstalledVersion"
|
||||||
|
destFile="/usr/local/bin/dialog"
|
||||||
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
|
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
|
||||||
printlog "$name not found or version not latest."
|
printlog "$name not found or version not latest."
|
||||||
printlog "${destFile}"
|
printlog "${destFile}"
|
||||||
|
|||||||
Reference in New Issue
Block a user