mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-21 13:20:59 +00:00
Merge pull request #359 from Installomator/Theile-labels-9.0
Theile labels 9.0
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
## v9?
|
## v9?
|
||||||
|
|
||||||
- We have moved the root check to the beginning of the script, and improved DEBUG handling with two different modes. `DEBUG=0` is still for production, and `1` is still for the DEBUG we previously knew downloading to the directory it is running from, but `2` will download to temporary folder, will detect updates, but will not install anything, but it will notify the user (almost as running the script without root before).
|
- We have moved the root check to the beginning of the script, and improved DEBUG handling with two different modes. `DEBUG=0` is still for production, and `1` is still for the DEBUG we previously knew downloading to the directory it is running from, but `2` will download to temporary folder, will detect updates, but will not install anything, but it will notify the user (almost as running the script without root before).
|
||||||
|
- `pkgName` in a label can now be searched for. An example is logitechoptions, where only the name of the pkg is given, and not the exact file path to it.
|
||||||
- `LSMinimumSystemVersion` will now be honered, if the `Info.plist` in the app is specifying this. That means that an app that has this parameter in that file and it shows that the app requires a newer version of the OS than is currently installed, then we will not install it.
|
- `LSMinimumSystemVersion` will now be honered, if the `Info.plist` in the app is specifying this. That means that an app that has this parameter in that file and it shows that the app requires a newer version of the OS than is currently installed, then we will not install it.
|
||||||
- New variable `RETURN_LABEL_NAME`. If given the value `1`, like `RETURN_LABEL_NAME=1` then Installomator only returns the name of the label. It makes for a better user friendly message for displaying in DEPNotify if that is integrated.
|
- New variable `RETURN_LABEL_NAME`. If given the value `1`, like `RETURN_LABEL_NAME=1` then Installomator only returns the name of the label. It makes for a better user friendly message for displaying in DEPNotify if that is integrated.
|
||||||
- Changed logic if `IGNORE_APP_STORE_APPS=yes`. Before this version a label like `microsoftonedrive` that was installed from App Store, and that we want to replace with the “ordinary” version, Installomator would still use `updateTool`, even though `IGNORE_APP_STORE_APPS=yes`. So we would have to have `INSTALL=force` in order to have the app replaced, as `updateTool` would be used. But now if `IGNORE_APP_STORE_APPS=yes` then `updateTool` will be not set, and the App Store app will be replaced. BUT if the installed software was not from App Store, then `updateTool` will not be used, and it would be a kind of a forced install (in the example of `microsoftonedrive`), except if the version is the same (where installation is skipped).
|
- Changed logic if `IGNORE_APP_STORE_APPS=yes`. Before this version a label like `microsoftonedrive` that was installed from App Store, and that we want to replace with the “ordinary” version, Installomator would still use `updateTool`, even though `IGNORE_APP_STORE_APPS=yes`. So we would have to have `INSTALL=force` in order to have the app replaced, as `updateTool` would be used. But now if `IGNORE_APP_STORE_APPS=yes` then `updateTool` will be not set, and the App Store app will be replaced. BUT if the installed software was not from App Store, then `updateTool` will not be used, and it would be a kind of a forced install (in the example of `microsoftonedrive`), except if the version is the same (where installation is skipped).
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
mightymike)
|
mightymike)
|
||||||
name="Nanosaur"
|
name="Mighty Mike"
|
||||||
type="dmg"
|
type="dmg"
|
||||||
downloadURL=$(downloadURLFromGit jorio MightyMike)
|
downloadURL=$(downloadURLFromGit jorio MightyMike)
|
||||||
appNewVersion=$(versionFromGit jorio MightyMike)
|
appNewVersion=$(versionFromGit jorio MightyMike)
|
||||||
7
fragments/disabled/mochakeyboard.sh
Normal file
7
fragments/disabled/mochakeyboard.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
mochakeyboard)
|
||||||
|
name="Mocha Keyboard"
|
||||||
|
type="appInDmgInZip"
|
||||||
|
downloadURL="https://mochasoft.dk/mochakeyboard.dmg.zip"
|
||||||
|
appNewVersion=""
|
||||||
|
expectedTeamID="RR9F5EPNVW"
|
||||||
|
;;
|
||||||
7
fragments/disabled/mochatelnet.sh
Normal file
7
fragments/disabled/mochatelnet.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
mochatelnet)
|
||||||
|
name="Telnet"
|
||||||
|
type="appInDmgInZip"
|
||||||
|
downloadURL="https://mochasoft.dk/telnet.dmg.zip"
|
||||||
|
appNewVersion=""
|
||||||
|
expectedTeamID="RR9F5EPNVW"
|
||||||
|
;;
|
||||||
7
fragments/disabled/mochatn3270.sh
Normal file
7
fragments/disabled/mochatn3270.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
mochatn3270)
|
||||||
|
name="TN3270"
|
||||||
|
type="appInDmgInZip"
|
||||||
|
downloadURL="https://mochasoft.dk/tn3270.dmg.zip"
|
||||||
|
appNewVersion=""
|
||||||
|
expectedTeamID="RR9F5EPNVW"
|
||||||
|
;;
|
||||||
7
fragments/disabled/mochatn3812.sh
Normal file
7
fragments/disabled/mochatn3812.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
mochatn3812)
|
||||||
|
name="TN3812"
|
||||||
|
type="appInDmgInZip"
|
||||||
|
downloadURL="https://mochasoft.dk/tn3812.dmg.zip"
|
||||||
|
appNewVersion=""
|
||||||
|
expectedTeamID="Frydendal"
|
||||||
|
;;
|
||||||
7
fragments/disabled/mochatn5250.sh
Normal file
7
fragments/disabled/mochatn5250.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
mochatn5250)
|
||||||
|
name="TN5250"
|
||||||
|
type="appInDmgInZip"
|
||||||
|
downloadURL="https://mochasoft.dk/tn5250.dmg.zip"
|
||||||
|
appNewVersion=""
|
||||||
|
expectedTeamID="RR9F5EPNVW"
|
||||||
|
;;
|
||||||
@@ -563,8 +563,19 @@ installPkgInDmg() {
|
|||||||
archiveName="${filearray[1]}"
|
archiveName="${filearray[1]}"
|
||||||
printlog "found pkg: $archiveName"
|
printlog "found pkg: $archiveName"
|
||||||
else
|
else
|
||||||
# it is now safe to overwrite archiveName for installFromPKG
|
if ls "$tmpDir/$pkgName" ; then
|
||||||
archiveName="$dmgmount/$pkgName"
|
archiveName="$tmpDir/$pkgName"
|
||||||
|
else
|
||||||
|
# try searching for pkg
|
||||||
|
findfiles=$(find "$tmpDir" -iname "$pkgName")
|
||||||
|
filearray=( ${(f)findfiles} )
|
||||||
|
if [[ ${#filearray} -eq 0 ]]; then
|
||||||
|
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName"
|
||||||
|
fi
|
||||||
|
# it is now safe to overwrite archiveName for installFromPKG
|
||||||
|
archiveName="${filearray[1]}"
|
||||||
|
printlog "found pkg: $archiveName"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# installFromPkgs
|
# installFromPkgs
|
||||||
@@ -584,12 +595,23 @@ installPkgInZip() {
|
|||||||
if [[ ${#filearray} -eq 0 ]]; then
|
if [[ ${#filearray} -eq 0 ]]; then
|
||||||
cleanupAndExit 20 "couldn't find pkg in zip $archiveName"
|
cleanupAndExit 20 "couldn't find pkg in zip $archiveName"
|
||||||
fi
|
fi
|
||||||
archiveName="${filearray[1]}"
|
|
||||||
# it is now safe to overwrite archiveName for installFromPKG
|
# it is now safe to overwrite archiveName for installFromPKG
|
||||||
|
archiveName="${filearray[1]}"
|
||||||
printlog "found pkg: $archiveName"
|
printlog "found pkg: $archiveName"
|
||||||
else
|
else
|
||||||
# it is now safe to overwrite archiveName for installFromPKG
|
if ls "$tmpDir/$pkgName" ; then
|
||||||
archiveName="$tmpDir/$pkgName"
|
archiveName="$tmpDir/$pkgName"
|
||||||
|
else
|
||||||
|
# try searching for pkg
|
||||||
|
findfiles=$(find "$tmpDir" -iname "$pkgName")
|
||||||
|
filearray=( ${(f)findfiles} )
|
||||||
|
if [[ ${#filearray} -eq 0 ]]; then
|
||||||
|
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName"
|
||||||
|
fi
|
||||||
|
# it is now safe to overwrite archiveName for installFromPKG
|
||||||
|
archiveName="${filearray[1]}"
|
||||||
|
printlog "found pkg: $archiveName"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# installFromPkgs
|
# installFromPkgs
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ REOPEN="yes"
|
|||||||
# blockingProcesses=( NONE )
|
# blockingProcesses=( NONE )
|
||||||
#
|
#
|
||||||
# - pkgName: (optional, only used for pkgInDmg, dmgInZip, and appInDmgInZip)
|
# - pkgName: (optional, only used for pkgInDmg, dmgInZip, and appInDmgInZip)
|
||||||
# File name of the pkg/dmg file _inside_ the dmg or zip
|
# File name or path to the pkg/dmg file _inside_ the dmg or zip.
|
||||||
# When not given the pkgName is derived from the $name
|
# When not given the pkgName is derived from the $name
|
||||||
#
|
#
|
||||||
# - updateTool:
|
# - updateTool:
|
||||||
|
|||||||
7
fragments/labels/applesfarabic.sh
Normal file
7
fragments/labels/applesfarabic.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
applesfarabic)
|
||||||
|
name="San Francisco Arabic"
|
||||||
|
type="pkgInDmg"
|
||||||
|
downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg"
|
||||||
|
packageID="com.apple.pkg.SFArabicFonts"
|
||||||
|
expectedTeamID="Software Update"
|
||||||
|
;;
|
||||||
@@ -2,7 +2,7 @@ applesfsymbols|\
|
|||||||
sfsymbols)
|
sfsymbols)
|
||||||
name="SF Symbols"
|
name="SF Symbols"
|
||||||
type="pkgInDmg"
|
type="pkgInDmg"
|
||||||
downloadURL=$( curl -fs "https://developer.apple.com/sf-symbols/" | grep -oe "https.*\.dmg" | head -1 )
|
downloadURL=$( curl -fs "https://developer.apple.com/sf-symbols/" | grep -oe "https.*Symbols.*\.dmg" | head -1 )
|
||||||
appNewVersion=$( echo "$downloadURL" | head -1 | sed -E 's/.*SF-Symbols-([0-9.]*)\..*/\1/g')
|
appNewVersion=$( echo "$downloadURL" | sed -E 's/.*SF-Symbols-([0-9.]*)\..*/\1/g')
|
||||||
expectedTeamID="Software Update"
|
expectedTeamID="Software Update"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
brave)
|
brave)
|
||||||
# credit: @securitygeneration
|
|
||||||
name="Brave Browser"
|
name="Brave Browser"
|
||||||
type="dmg"
|
type="dmg"
|
||||||
if [[ $(arch) != "i386" ]]; then
|
if [[ $(arch) != "i386" ]]; then
|
||||||
printlog "Architecture: arm64 (not i386)"
|
printlog "Architecture: arm64 (not i386)"
|
||||||
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | awk '{print $2}' | tr -d '\r\n')
|
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | awk '{print $2}')
|
||||||
|
appNewVersion="$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable-arm64/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2)"
|
||||||
|
#appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable-arm64/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)"
|
||||||
else
|
else
|
||||||
printlog "Architecture: i386"
|
printlog "Architecture: i386"
|
||||||
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | awk '{print $2}' | tr -d '\r\n')
|
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | awk '{print $2}')
|
||||||
|
appNewVersion="$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2)"
|
||||||
|
#appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)"
|
||||||
fi
|
fi
|
||||||
# downloadURL=$(curl --location --fail --silent "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2)
|
versionKey="CFBundleVersion"
|
||||||
appNewVersion=$(curl --location --fail --silent "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2)
|
# downloadURL=$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2)
|
||||||
expectedTeamID="KL8N8XSYF4"
|
expectedTeamID="KL8N8XSYF4"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
depnotify)
|
depnotify)
|
||||||
name="DEPNotify"
|
name="DEPNotify"
|
||||||
type="zip"
|
type="pkg"
|
||||||
downloadURL="https://files.nomad.menu/DEPNotify.zip"
|
#packageID="menu.nomad.depnotify"
|
||||||
|
downloadURL="https://files.nomad.menu/DEPNotify.pkg"
|
||||||
|
#appNewVersion=$()
|
||||||
expectedTeamID="VRPY9KHGX6"
|
expectedTeamID="VRPY9KHGX6"
|
||||||
targetDir="/Applications/Utilities"
|
|
||||||
;;
|
;;
|
||||||
|
|||||||
7
fragments/labels/ibarcoder.sh
Normal file
7
fragments/labels/ibarcoder.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
ibarcoder)
|
||||||
|
name="iBarcoder"
|
||||||
|
type="dmg"
|
||||||
|
downloadURL="https://cristallight.com/Downloads/mac/ibarcoder.dmg"
|
||||||
|
appNewVersion="$(curl -fs "https://cristallight.com/iBarcoder/" | grep -i version: | head -1 | awk '{print $2}')"
|
||||||
|
expectedTeamID="JAXVB9AH9M"
|
||||||
|
;;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
logitechoptions)
|
logitechoptions)
|
||||||
# credit: AP Orlebeke (@apizz)
|
|
||||||
name="Logitech Options"
|
name="Logitech Options"
|
||||||
type="pkgInZip"
|
type="pkgInZip"
|
||||||
downloadURL=$(curl -fs -L https://www.logitech.com/en-us/product/options | grep -m 1 -o "https.*zip" | sed 's/\"//' | awk '{print $1}')
|
downloadURL=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -oie "https.*/.*/options.*\.zip")
|
||||||
#appNewVersion=$(curl -fs -L https://www.logitech.com/en-us/product/options | grep -m 1 -o "https.*zip" | sed 's/\"//' | awk '{print $1}' | sed -E 's/.*_([0-9\.]*)[-\.].*/\1/' )
|
appNewVersion=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -B 5 -ie "https.*/.*/options.*\.zip" | grep "Software Version" | sed 's/\\u[0-9a-z][0-9a-z][0-9a-z][0-9a-z]//g' | grep -ioe "Software Version.*[0-9.]*" | tr "/" "\n" | grep -oe "[0-9.]*" | head -1)
|
||||||
pkgName="LogiMgr Installer ${appNewVersion}.app/Contents/Resources/LogiMgr.pkg"
|
#pkgName="LogiMgr Installer "*".app/Contents/Resources/LogiMgr.pkg"
|
||||||
|
pkgName=LogiMgr.pkg
|
||||||
expectedTeamID="QED4VVPZWA"
|
expectedTeamID="QED4VVPZWA"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -5,4 +5,3 @@ ottomatic)
|
|||||||
appNewVersion=$(versionFromGit jorio OttoMatic)
|
appNewVersion=$(versionFromGit jorio OttoMatic)
|
||||||
expectedTeamID="RVNL7XC27G"
|
expectedTeamID="RVNL7XC27G"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
7
fragments/labels/sdnotary.sh
Normal file
7
fragments/labels/sdnotary.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
sdnotary)
|
||||||
|
name="SD Notary"
|
||||||
|
type="zip"
|
||||||
|
downloadURL=$(curl -fs https://latenightsw.com/sd-notary-notarizing-made-easy/ | grep -io "https://.*/.*\.zip")
|
||||||
|
appNewVersion=$(echo "$downloadURL" | sed -E 's/.*\/[a-zA-Z]*([0-9.]*)-.*\.zip/\1/g')
|
||||||
|
expectedTeamID="Z7S6X96M3X"
|
||||||
|
;;
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
signal)
|
signal)
|
||||||
# credit: Søren Theilgaard (@theilgaard)
|
|
||||||
name="Signal"
|
name="Signal"
|
||||||
type="dmg"
|
type="dmg"
|
||||||
downloadURL=https://updates.signal.org/desktop/$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | awk '/url/ && /dmg/ {print $3}')
|
downloadURL=https://updates.signal.org/desktop/$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | awk '/url/ && /dmg/ {print $3}' | grep -i universal)
|
||||||
appNewVersion=$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | grep version | awk '{print $2}')
|
appNewVersion=$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | grep version | awk '{print $2}')
|
||||||
expectedTeamID="U68MSDN6DR"
|
expectedTeamID="U68MSDN6DR"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -82,6 +82,43 @@ pkgInvestigation() {
|
|||||||
echo "$packageID"
|
echo "$packageID"
|
||||||
echo "Above is the possible packageIDs that can be used, and the correct one is probably one of those with a version number. More investigation might be needed to figure out correct packageID if several are displayed."
|
echo "Above is the possible packageIDs that can be used, and the correct one is probably one of those with a version number. More investigation might be needed to figure out correct packageID if several are displayed."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dmgInvestigation() {
|
||||||
|
echo "DMG investigation."
|
||||||
|
# mount the dmg
|
||||||
|
echo "Mounting $archiveName"
|
||||||
|
if ! dmgmount=$(echo "Y"$'\n' | hdiutil attach "$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then
|
||||||
|
echo "Error mounting $archiveName"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
echo "Mounted: $dmgmount"
|
||||||
|
|
||||||
|
# check if app og pkg exists on disk image
|
||||||
|
appPath=$(find "$dmgmount" -name "*.app" -maxdepth 1 -print )
|
||||||
|
pkgPath=$(find "$dmgmount" -name "*.pkg" -maxdepth 1 -print )
|
||||||
|
|
||||||
|
if [[ $appPath != "" ]]; then
|
||||||
|
echo "App found: $appPath"
|
||||||
|
if [[ $archiveExt = "dmgInZip" ]]; then
|
||||||
|
archiveExt="appInDmgInZip"
|
||||||
|
fi
|
||||||
|
appInvestigation
|
||||||
|
elif [[ $pkgPath != "" ]]; then
|
||||||
|
echo "PKG found: $pkgPath"
|
||||||
|
if [[ $archiveExt = "dmgInZip" ]]; then
|
||||||
|
archiveExt="pkgInDmgInZip not supported, yet!"
|
||||||
|
else
|
||||||
|
archiveExt="pkgInDmg"
|
||||||
|
fi
|
||||||
|
pkgInvestigation
|
||||||
|
else
|
||||||
|
echo "Nothing found on DMG."
|
||||||
|
exit 9
|
||||||
|
fi
|
||||||
|
|
||||||
|
hdiutil detach "$dmgmount"
|
||||||
|
}
|
||||||
|
|
||||||
appInvestigation() {
|
appInvestigation() {
|
||||||
appName=${appPath##*/}
|
appName=${appPath##*/}
|
||||||
name=${appName%.*}
|
name=${appName%.*}
|
||||||
@@ -122,19 +159,22 @@ if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -
|
|||||||
echo "result: $downloadOut"
|
echo "result: $downloadOut"
|
||||||
echo "Trying all headers…" # that I know of
|
echo "Trying all headers…" # that I know of
|
||||||
if ! downloadOut="$(curl -fL -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -H "accept-encoding: gzip, deflate, br" -H "Referrer Policy: strict-origin-when-cross-origin" -H "upgrade-insecure-requests: 1" -H "sec-fetch-dest: document" -H "sec-gpc: 1" -H "sec-fetch-user: ?1" -H "accept-language: en-US,en;q=0.9" -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "sec-fetch-mode: navigate" "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
if ! downloadOut="$(curl -fL -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -H "accept-encoding: gzip, deflate, br" -H "Referrer Policy: strict-origin-when-cross-origin" -H "upgrade-insecure-requests: 1" -H "sec-fetch-dest: document" -H "sec-gpc: 1" -H "sec-fetch-user: ?1" -H "accept-language: en-US,en;q=0.9" -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "sec-fetch-mode: navigate" "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
||||||
# we are only here if the download failed
|
echo "Trying almost all headers…" # that I know of
|
||||||
echo "error downloading $downloadURL using all headers."
|
if ! downloadOut="$(curl -fL -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -H "accept-encoding: gzip, deflate, br" -H "upgrade-insecure-requests: 1" -H "sec-fetch-dest: document" -H "sec-gpc: 1" -H "sec-fetch-user: ?1" -H "accept-language: en-US,en;q=0.9" -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "sec-fetch-mode: navigate" "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
||||||
echo "result: $downloadOut"
|
# we are only here if the download failed
|
||||||
# Sometimes a server will give some results to the downloaded output
|
echo "error downloading $downloadURL using two different sets of headers."
|
||||||
if [[ -n $downloadOut ]]; then
|
echo "result: $downloadOut"
|
||||||
echo "Trying output of this…"
|
# Sometimes a server will give some results to the downloaded output
|
||||||
downloadURL="$(echo $downloadOut | tail -1)"
|
if [[ -n $downloadOut ]]; then
|
||||||
# Last chance for succes on this download
|
echo "Trying output of this…"
|
||||||
if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
downloadURL="$(echo $downloadOut | tail -1)"
|
||||||
echo "error downloading $downloadURL using previous output."
|
# Last chance for succes on this download
|
||||||
echo "result: $downloadOut"
|
if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
||||||
echo "No more tries. Cannot continue."
|
echo "error downloading $downloadURL using previous output."
|
||||||
exit 1
|
echo "result: $downloadOut"
|
||||||
|
echo "No more tries. Cannot continue."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -171,10 +211,6 @@ echo "name: $name"
|
|||||||
archiveExt=${archiveName##*.}
|
archiveExt=${archiveName##*.}
|
||||||
type=$archiveExt
|
type=$archiveExt
|
||||||
echo "archiveExt: $archiveExt"
|
echo "archiveExt: $archiveExt"
|
||||||
identifier=${name:l} # making lower case
|
|
||||||
identifier=${identifier//\%[0-9a-fA-F][0-9a-fA-F]} # removing certain characters
|
|
||||||
identifier=${identifier//[,._*@$\(\)\-]} # removing more characters from label name
|
|
||||||
echo "identifier: $identifier"
|
|
||||||
|
|
||||||
# Now figuring out the filename extension and handling those situations
|
# Now figuring out the filename extension and handling those situations
|
||||||
if [ "$archiveExt" = "pkg" ]; then
|
if [ "$archiveExt" = "pkg" ]; then
|
||||||
@@ -183,31 +219,7 @@ if [ "$archiveExt" = "pkg" ]; then
|
|||||||
pkgInvestigation
|
pkgInvestigation
|
||||||
elif [ "$archiveExt" = "dmg" ]; then
|
elif [ "$archiveExt" = "dmg" ]; then
|
||||||
echo "Diskimage found"
|
echo "Diskimage found"
|
||||||
# mount the dmg
|
dmgInvestigation
|
||||||
echo "Mounting $archiveName"
|
|
||||||
if ! dmgmount=$(echo "Y"$'\n' | hdiutil attach "$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then
|
|
||||||
echo "Error mounting $archiveName"
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
echo "Mounted: $dmgmount"
|
|
||||||
|
|
||||||
# check if app og pkg exists on disk image
|
|
||||||
appPath=$(find "$dmgmount" -name "*.app" -maxdepth 1 -print )
|
|
||||||
pkgPath=$(find "$dmgmount" -name "*.pkg" -maxdepth 1 -print )
|
|
||||||
|
|
||||||
if [[ $appPath != "" ]]; then
|
|
||||||
echo "App found: $appPath"
|
|
||||||
appInvestigation
|
|
||||||
elif [[ $pkgPath != "" ]]; then
|
|
||||||
echo "PKG found: $pkgPath"
|
|
||||||
archiveExt="pkgInDmg"
|
|
||||||
pkgInvestigation
|
|
||||||
else
|
|
||||||
echo "Nothing found on DMG."
|
|
||||||
exit 9
|
|
||||||
fi
|
|
||||||
|
|
||||||
hdiutil detach "$dmgmount"
|
|
||||||
elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
|
elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
|
||||||
echo "Compressed file found"
|
echo "Compressed file found"
|
||||||
# unzip the archive
|
# unzip the archive
|
||||||
@@ -216,6 +228,7 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
|
|||||||
# check if app og pkg exists after expanding
|
# check if app og pkg exists after expanding
|
||||||
appPath=$(find "$tmpDir" -name "*.app" -maxdepth 2 -print )
|
appPath=$(find "$tmpDir" -name "*.app" -maxdepth 2 -print )
|
||||||
pkgPath=$(find "$tmpDir" -name "*.pkg" -maxdepth 2 -print )
|
pkgPath=$(find "$tmpDir" -name "*.pkg" -maxdepth 2 -print )
|
||||||
|
archiveName=$(find "$tmpDir" -name "*.dmg" -maxdepth 2 -print )
|
||||||
|
|
||||||
if [[ $appPath != "" ]]; then
|
if [[ $appPath != "" ]]; then
|
||||||
echo "App found: $appPath"
|
echo "App found: $appPath"
|
||||||
@@ -223,14 +236,24 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
|
|||||||
elif [[ $pkgPath != "" ]]; then
|
elif [[ $pkgPath != "" ]]; then
|
||||||
echo "PKG found: $pkgPath"
|
echo "PKG found: $pkgPath"
|
||||||
archiveExt="pkgInZip"
|
archiveExt="pkgInZip"
|
||||||
|
echo "archiveExt: $archiveExt"
|
||||||
pkgInvestigation
|
pkgInvestigation
|
||||||
|
elif [[ $archiveName != "" ]]; then
|
||||||
|
echo "Disk image found: $archiveName"
|
||||||
|
archiveExt="dmgInZip"
|
||||||
|
echo "archiveExt: $archiveExt"
|
||||||
|
dmgInvestigation
|
||||||
else
|
else
|
||||||
echo "Nothing found in compressed archive."
|
echo "Nothing found in compressed archive."
|
||||||
exit 9
|
exit 9
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
identifier=${name:l} # making lower case
|
||||||
|
identifier=${identifier//\%[0-9a-fA-F][0-9a-fA-F]} # removing certain characters
|
||||||
|
identifier=${identifier//[,._*@$\(\)\-]} # removing more characters from label name
|
||||||
|
echo "identifier: $identifier"
|
||||||
|
|
||||||
# github-part to figure out if we can find author and repo, to use our github functions for the label
|
# github-part to figure out if we can find author and repo, to use our github functions for the label
|
||||||
if echo "$downloadURL" | grep -i "github.com.*releases/download"; then
|
if echo "$downloadURL" | grep -i "github.com.*releases/download"; then
|
||||||
echo "\n**********\n\nFound GitHub path"
|
echo "\n**********\n\nFound GitHub path"
|
||||||
|
|||||||
Reference in New Issue
Block a user