diff --git a/fragments/arguments.sh b/fragments/arguments.sh index 08bf110..26e4192 100644 --- a/fragments/arguments.sh +++ b/fragments/arguments.sh @@ -45,6 +45,11 @@ fi printlog "################## Start Installomator v. $VERSION" printlog "################## $label" +# Check for DEBUG mode +if [[ $DEBUG -gt 0 ]]; then + printlog "DEBUG mode $DEBUG enabled." +fi + # How we get version number from app # (alternative is "CFBundleVersion", that can be used in labels) versionKey="CFBundleShortVersionString" diff --git a/fragments/labels/microsoftcompanyportal.sh b/fragments/labels/microsoftcompanyportal.sh index 6285730..a75b495 100644 --- a/fragments/labels/microsoftcompanyportal.sh +++ b/fragments/labels/microsoftcompanyportal.sh @@ -5,7 +5,7 @@ microsoftcompanyportal) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.intunecompanyportal.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/CompanyPortal_.*pkg" | cut -d "_" -f 2 | cut -d "-" -f 1) expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftdefenderatp.sh b/fragments/labels/microsoftdefenderatp.sh index a156277..c73c090 100644 --- a/fragments/labels/microsoftdefenderatp.sh +++ b/fragments/labels/microsoftdefenderatp.sh @@ -5,7 +5,7 @@ microsoftdefenderatp) appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.defender.standalone"]/version' 2>/dev/null | sed -E 's/([0-9.]*) .*/\1/') # No version number in download url expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftedge.sh b/fragments/labels/microsoftedge.sh index b252929..46f726a 100644 --- a/fragments/labels/microsoftedge.sh +++ b/fragments/labels/microsoftedge.sh @@ -7,7 +7,7 @@ microsoftedgeenterprisestable) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.edge"]/cfbundleversion' 2>/dev/null | sed -E 's/([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/MicrosoftEdge.*pkg" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftexcel.sh b/fragments/labels/microsoftexcel.sh index 7c57ac0..a27367e 100644 --- a/fragments/labels/microsoftexcel.sh +++ b/fragments/labels/microsoftexcel.sh @@ -5,7 +5,7 @@ microsoftexcel) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.excel.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftoffice365.sh b/fragments/labels/microsoftoffice365.sh index c6b240e..e7de7a7 100644 --- a/fragments/labels/microsoftoffice365.sh +++ b/fragments/labels/microsoftoffice365.sh @@ -7,7 +7,7 @@ microsoftoffice365) expectedTeamID="UBF8T346G9" # using MS PowerPoint as the 'stand-in' for the entire suite #appName="Microsoft PowerPoint.app" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftofficebusinesspro.sh b/fragments/labels/microsoftofficebusinesspro.sh index 739a21b..68f0cdb 100644 --- a/fragments/labels/microsoftofficebusinesspro.sh +++ b/fragments/labels/microsoftofficebusinesspro.sh @@ -6,7 +6,7 @@ microsoftofficebusinesspro) expectedTeamID="UBF8T346G9" # using MS PowerPoint as the 'stand-in' for the entire suite appName="Microsoft PowerPoint.app" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftonedrive.sh b/fragments/labels/microsoftonedrive.sh index 722a7a4..d7df8d7 100644 --- a/fragments/labels/microsoftonedrive.sh +++ b/fragments/labels/microsoftonedrive.sh @@ -5,7 +5,7 @@ microsoftonedrive) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.onedrive.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | cut -d "/" -f 6 | cut -d "." -f 1-3) expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftonenote.sh b/fragments/labels/microsoftonenote.sh index c3ffea0..cb86c78 100644 --- a/fragments/labels/microsoftonenote.sh +++ b/fragments/labels/microsoftonenote.sh @@ -5,7 +5,7 @@ microsoftonenote) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.onenote.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftoutlook.sh b/fragments/labels/microsoftoutlook.sh index ef48e10..7b4b02c 100644 --- a/fragments/labels/microsoftoutlook.sh +++ b/fragments/labels/microsoftoutlook.sh @@ -5,7 +5,7 @@ microsoftoutlook) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.outlook.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftpowerpoint.sh b/fragments/labels/microsoftpowerpoint.sh index f00e30e..4798a96 100644 --- a/fragments/labels/microsoftpowerpoint.sh +++ b/fragments/labels/microsoftpowerpoint.sh @@ -5,7 +5,7 @@ microsoftpowerpoint) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.powerpoint.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftremotedesktop.sh b/fragments/labels/microsoftremotedesktop.sh index 2707be4..753ae13 100644 --- a/fragments/labels/microsoftremotedesktop.sh +++ b/fragments/labels/microsoftremotedesktop.sh @@ -5,7 +5,7 @@ microsoftremotedesktop) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.remotedesktop.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_Remote_Desktop.*pkg" | cut -d "_" -f 4) expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftskypeforbusiness.sh b/fragments/labels/microsoftskypeforbusiness.sh index bfc2de9..1b2518c 100644 --- a/fragments/labels/microsoftskypeforbusiness.sh +++ b/fragments/labels/microsoftskypeforbusiness.sh @@ -5,7 +5,7 @@ microsoftskypeforbusiness) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.skypeforbusiness.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="UBF8T346G9" - if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then printlog "Running msupdate --list" "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list fi diff --git a/fragments/labels/microsoftvisualstudiocode.sh b/fragments/labels/microsoftvisualstudiocode.sh index 85a4e68..be06f44 100644 --- a/fragments/labels/microsoftvisualstudiocode.sh +++ b/fragments/labels/microsoftvisualstudiocode.sh @@ -2,7 +2,6 @@ microsoftvisualstudiocode|\ visualstudiocode) name="Visual Studio Code" type="zip" - #downloadURL="https://go.microsoft.com/fwlink/?LinkID=620882" # Intel only downloadURL="https://go.microsoft.com/fwlink/?LinkID=2156837" # Universal appNewVersion=$(curl -fsL "https://code.visualstudio.com/Updates" | grep "/darwin" | grep -oiE ".com/([^>]+)([^<]+)/darwin" | cut -d "/" -f 2 | sed $'s/[^[:print:] ]//g' | head -1 ) expectedTeamID="UBF8T346G9"