├── .gitignore ├── README.md ├── di-1password.sh ├── di-accordance.sh ├── di-acorn.sh ├── di-aerial.sh ├── di-airbuddy.sh ├── di-airflow.sh ├── di-airfoil.sh ├── di-alfred.sh ├── di-apptamer.sh ├── di-appzapper.sh ├── di-arq.sh ├── di-atext.sh ├── di-audiobookbuilder.sh ├── di-audiohijack.sh ├── di-auto.sh ├── di-backblaze.sh ├── di-backuploupe.sh ├── di-bbautocomplete.sh ├── di-bbedit.sh ├── di-bettertouchtool.sh ├── di-betterzip.sh ├── di-beyondcompare.sh ├── di-bibdesk.sh ├── di-bleunlock.sh ├── di-boostnote.sh ├── di-brave.sh ├── di-bunch.sh ├── di-busycal.sh ├── di-busycontacts.sh ├── di-butler.sh ├── di-calibre.sh ├── di-camostudio.sh ├── di-carboncopycloner.sh ├── di-cardhop.sh ├── di-catch.sh ├── di-changes.sh ├── di-charles.sh ├── di-cheatsheet.sh ├── di-choosy.sh ├── di-chronosync.sh ├── di-cleantext.sh ├── di-clickerforamazonprime.sh ├── di-clickerfordisneyplus.sh ├── di-clickerforhbomax.sh ├── di-clickerfornetflix.sh ├── di-clickerforyoutube.sh ├── di-cocktail.sh ├── di-cocoapacketanalyzer.sh ├── di-coda.sh ├── di-coderunner.sh ├── di-coherencex.sh ├── di-contexts.sh ├── di-cookie.sh ├── di-cyberduck.sh ├── di-daisydisk.sh ├── di-dash.sh ├── di-defaultfolderx.sh ├── di-descript.sh ├── di-desktopcurtain.sh ├── di-detectxswift.sh ├── di-devonthink3.sh ├── di-discord.sh ├── di-displays.sh ├── di-dndme.sh ├── di-downie4.sh ├── di-drafts-beta.sh ├── di-drivedx.sh ├── di-dropbox.sh ├── di-dropdmg.sh ├── di-dropshare.sh ├── di-dropzone.sh ├── di-duetdisplay.sh ├── di-eaglefiler.sh ├── di-ears.sh ├── di-easyfind.sh ├── di-encryptme.sh ├── di-endurance.sh ├── di-evernote.sh ├── di-expandrive.sh ├── di-fantastical.sh ├── di-fastscripts.sh ├── di-feeder.sh ├── di-filejuicer.sh ├── di-finereaderpro.sh ├── di-firefox.sh ├── di-fission.sh ├── di-fluid.sh ├── di-flux.sh ├── di-fmail2.sh ├── di-fork.sh ├── di-forklift.sh ├── di-freeruler.sh ├── di-fsnotes.sh ├── di-geektool.sh ├── di-gisto.sh ├── di-gitfinder.sh ├── di-githubdesktop.sh ├── di-gitkraken.sh ├── di-googlechrome.sh ├── di-grammarly.sh ├── di-handbrake.sh ├── di-hazel.sh ├── di-historyhound.sh ├── di-hookmark.sh ├── di-horcrux.sh ├── di-houdahspot.sh ├── di-ibettercharge.sh ├── di-iina.sh ├── di-imagealpha.sh ├── di-imageoptim.sh ├── di-imazing.sh ├── di-istatmenus.sh ├── di-istatserver.sh ├── di-iterm.sh ├── di-itsycal.sh ├── di-jettison.sh ├── di-johnsbackgroundswitcher.sh ├── di-jointogether.sh ├── di-juice.sh ├── di-jumpdesktop.sh ├── di-jumpdesktopconnect.sh ├── di-karabiner.sh ├── di-keepingyouawake.sh ├── di-keepit.sh ├── di-keka.sh ├── di-keybase.sh ├── di-keyboardmaestro.sh ├── di-keycastr.sh ├── di-keycodes.sh ├── di-keycue.sh ├── di-keymou.sh ├── di-kiwiforgmail.sh ├── di-launchbar.sh ├── di-launchcontrol.sh ├── di-launchpadmanager.sh ├── di-leech.sh ├── di-lingonx.sh ├── di-littlesnitch.sh ├── di-loading.sh ├── di-logos.sh ├── di-loopback.sh ├── di-losslesscut.sh ├── di-lunadisplay.sh ├── di-lunar.sh ├── di-lunasecondary.sh ├── di-m4vgear.sh ├── di-machineprofile.sh ├── di-macpilot.sh ├── di-mactracker.sh ├── di-macupdater.sh ├── di-maestral.sh ├── di-mailmate.sh ├── di-mailspring.sh ├── di-makemkv.sh ├── di-malwarebytes.sh ├── di-marked.sh ├── di-marktext.sh ├── di-marsedit.sh ├── di-menuwhere.sh ├── di-microblog.sh ├── di-microsnitch.sh ├── di-microsoftedge.sh ├── di-mimestream.sh ├── di-miniusage.sh ├── di-mkvtoolnix.sh ├── di-monodraw.sh ├── di-monofocus.sh ├── di-monolingual.sh ├── di-moom.sh ├── di-mountain.sh ├── di-namemangler.sh ├── di-netnewswire.sh ├── di-netspot.sh ├── di-networkradar.sh ├── di-networkutility.sh ├── di-nisuswriterpro.sh ├── di-notion.sh ├── di-nottingham.sh ├── di-nova.sh ├── di-nvalt.sh ├── di-obsidian.sh ├── di-omnidisksweeper.sh ├── di-omnifocus.sh ├── di-omnigraffle.sh ├── di-omnioutliner.sh ├── di-omniplan.sh ├── di-omniweb.sh ├── di-onedrive.sh ├── di-oneswitch.sh ├── di-onyx.sh ├── di-optimusplayer.sh ├── di-paparazzi.sh ├── di-pathfinder.sh ├── di-pdfexpert.sh ├── di-permute.sh ├── di-plexmediaserver.sh ├── di-posthaste.sh ├── di-powermanager.sh ├── di-powerphotos.sh ├── di-printopia.sh ├── di-quitter.sh ├── di-radiosilence.sh ├── di-rapidweaver.sh ├── di-raycast.sh ├── di-rectangle.sh ├── di-reflector.sh ├── di-resiliosync.sh ├── di-resolutionator.sh ├── di-rocket.sh ├── di-screenflow.sh ├── di-screens.sh ├── di-screensconnect.sh ├── di-scriptdebugger.sh ├── di-scrivener.sh ├── di-semulov.sh ├── di-sequelpro.sh ├── di-setapp.sh ├── di-sharpshooter.sh ├── di-shifty.sh ├── di-shortcat.sh ├── di-shotcut.sh ├── di-simon.sh ├── di-skim.sh ├── di-skype.sh ├── di-slack.sh ├── di-sloth.sh ├── di-smartgit.sh ├── di-smartsleep.sh ├── di-soulver.sh ├── di-soundsource.sh ├── di-sourcetree.sh ├── di-spamsieve.sh ├── di-spotdox.sh ├── di-sshconfigeditor.sh ├── di-sshtunnelmanager.sh ├── di-stackexchangenotifier.sh ├── di-stopthenews.sh ├── di-streamdeck.sh ├── di-stretchlink.sh ├── di-strongsync.sh ├── di-sublimetext.sh ├── di-submarine.sh ├── di-superduper.sh ├── di-suspiciouspackage.sh ├── di-swiftbar.sh ├── di-swiftdefaultapps.sh ├── di-tableflip.sh ├── di-tapforms.sh ├── di-taskpaper.sh ├── di-teams.sh ├── di-techtool.sh ├── di-texifier.sh ├── di-texshop.sh ├── di-textbuddy.sh ├── di-textexpander.sh ├── di-textual.sh ├── di-there.sh ├── di-theunarchiver.sh ├── di-thunderbird.sh ├── di-timemachineeditor.sh ├── di-timesink.sh ├── di-timing.sh ├── di-tower.sh ├── di-transmission.sh ├── di-transmit.sh ├── di-trickster.sh ├── di-tripmode.sh ├── di-typinator.sh ├── di-typora.sh ├── di-ubar.sh ├── di-uebersicht.sh ├── di-unlox.sh ├── di-unpkg.sh ├── di-usher.sh ├── di-vellum.sh ├── di-vlc.sh ├── di-vpnunlimited.sh ├── di-witch.sh ├── di-xld.sh ├── di-xquartz.sh ├── di-xscope.sh ├── di-yojimbo.sh ├── di-yubico-authenticator.sh ├── di-zoom.sh ├── discontinued ├── OLD-di-bartender.sh ├── OLD-di-macpilot.sh ├── OLD-di-zoom.sh ├── di-1password6.sh ├── di-1password7.sh ├── di-32bitcheck.sh ├── di-acorn7.sh ├── di-alfred.sh ├── di-alfred2.sh ├── di-alfred3.sh ├── di-alfred4.sh ├── di-appfixer.sh ├── di-arq5.sh ├── di-atmonitor.sh ├── di-authy.sh ├── di-bartender2.sh ├── di-bartender3.sh ├── di-bartender4.sh ├── di-batteryalert.sh ├── di-bbedit-beta.sh ├── di-bbedit-meta.sh ├── di-beamer.sh ├── di-bitbar.sh ├── di-boringoldmenubar.sh ├── di-callrecorder.sh ├── di-carboncopycloner-all-macos-versions.sh ├── di-carboncopycloner3.sh ├── di-carboncopycloner4.sh ├── di-carboncopycloner5.sh ├── di-charles3.sh ├── di-chatology.sh ├── di-choosy1.sh ├── di-cisdemocrwizard.sh ├── di-clarify.sh ├── di-clipy.sh ├── di-cloudpull.sh ├── di-dash3.sh ├── di-dash4.sh ├── di-delibar.sh ├── di-deliciouslibrary.sh ├── di-deltawalker.sh ├── di-detectx.sh ├── di-devonthinkprooffice.sh ├── di-downie3.sh ├── di-dragthing.sh ├── di-fastmate.sh ├── di-flash-old.sh ├── di-flash.sh ├── di-fluid1.sh ├── di-fluid2.sh ├── di-fmail.sh ├── di-foreversave.sh ├── di-gitbox.sh ├── di-githubdesktopclassic.sh ├── di-handbrake-nightly.sh ├── di-hazel4.sh ├── di-hazel5.sh ├── di-hocusfocus.sh ├── di-imageoptim-beta.sh ├── di-intelpowergadget.sh ├── di-interarchy.sh ├── di-ipscanner.sh ├── di-istatmenus5.sh ├── di-istatmenus6.sh ├── di-iterm-nightly.sh ├── di-kaleidoscope.sh ├── di-karabiner.sh ├── di-kindle.sh ├── di-knock.sh ├── di-latest.sh ├── di-lingonx-old.sh ├── di-lingonx2.sh ├── di-liteicon.sh ├── di-littlesnitch4.sh ├── di-littlesnitch5.sh ├── di-lockdown.sh ├── di-logos6.sh ├── di-logos7.sh ├── di-mailplane.sh ├── di-mailplane3.sh ├── di-mailplane4.sh ├── di-marsedit3.sh ├── di-meetcam.sh ├── di-mousepose.sh ├── di-neoofficeviewer.sh ├── di-noteburnerm4vconverterplus.sh ├── di-office2011.sh ├── di-omnifocus2.sh ├── di-omnifocus3.sh ├── di-omnigraffle6.sh ├── di-omnioutliner4.sh ├── di-optimage.sh ├── di-pathfinder7.sh ├── di-pdfpenpro.sh ├── di-phoenix.sh ├── di-phoneview.sh ├── di-postbox.sh ├── di-powermanager4.sh ├── di-pretzel.sh ├── di-printopia2-or-3.sh ├── di-printopia2.sh ├── di-printopia3.sh ├── di-quickcal.sh ├── di-rdm.sh ├── di-revisions.sh ├── di-rsyncosx.sh ├── di-screens3.sh ├── di-screens4.sh ├── di-screensharingmenulet.sh ├── di-scrivener2.sh ├── di-seil.sh ├── di-sidekick.sh ├── di-skypecallrecorder.sh ├── di-soundclouddownloader.sh ├── di-soundnode.sh ├── di-spectacle.sh ├── di-stackmenu.sh ├── di-startupizer.sh ├── di-sublimetext.sh ├── di-subtitles.sh ├── di-textbar.sh ├── di-textexpander-beta.sh ├── di-textexpander.sh ├── di-textexpander5.sh ├── di-textexpander6.sh ├── di-toggl.sh ├── di-tower2.sh ├── di-transporterdesktop.sh ├── di-turboboostswitcherpro.sh ├── di-virtualhostx.sh └── di-vmware.sh ├── hoakleyelc ├── di-apfelstrudel.sh ├── di-cirrus.sh ├── di-consolation.sh ├── di-delighted.sh ├── di-dintch.sh ├── di-dystextia.sh ├── di-fintch.sh ├── di-lockrattler.sh ├── di-nalaprop.sh ├── di-permissionscanner.sh ├── di-podofyllin.sh ├── di-precize.sh ├── di-revisionist.sh ├── di-signet.sh ├── di-silentknight.sh ├── di-systhist.sh ├── di-taccy.sh ├── di-thetimemachinemechanic.sh ├── di-ulbow.sh └── di-xattred.sh ├── img └── github-raw.jpg ├── launchd ├── README.md ├── com.tjluoma.di-auto.sh └── old │ ├── README.md │ └── com.tjluoma.di-all.plist └── objective-see ├── di-blockblock.sh ├── di-dhs.sh ├── di-donotdisturb.sh ├── di-kextviewr.sh ├── di-knockknock.sh ├── di-lulu.sh ├── di-netiquette.sh ├── di-ostiarius.sh ├── di-oversight.sh ├── di-ransomwhere.sh ├── di-reikey.sh ├── di-taskexplorer.sh └── di-whatsyoursign.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | di.lst 3 | *-private.sh 4 | @TODO-* 5 | /@TODO.txt 6 | .sync 7 | Icon 8 | -------------------------------------------------------------------------------- /di-1password.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Install 1Password version 8 (note: will not update an installed version) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2025-02-15 7 | # Verified: 2025-02-15 8 | 9 | NAME="$0:t:r" 10 | 11 | PREFLIGHT="$HOME/.config/di/preflight.sh" 12 | 13 | [[ -s "$PREFLIGHT" ]] && source "$PREFLIGHT" 14 | 15 | ## NOTE: The app _must_ be installed at /Applications/ to work 16 | INSTALL_TO="/Applications/1Password.app" 17 | 18 | HOMEPAGE="https://1password.com" 19 | 20 | DOWNLOAD_PAGE="https://1password.com/downloads/" 21 | 22 | DIRECT_DOWNLOAD='https://downloads.1password.com/mac/1Password.zip' 23 | 24 | SUMMARY="Go ahead. Forget your passwords. 1Password remembers them all for you. Save your passwords and log in to sites with a single click. It's that simple." 25 | 26 | if [[ -e "$HOME/.path" ]] 27 | then 28 | source "$HOME/.path" 29 | fi 30 | 31 | ############################################################################################### 32 | 33 | if [[ -e "$INSTALL_TO" ]] 34 | then 35 | 36 | echo "$NAME: Fatal error: 1Password is already installed at '$INSTALL_TO'. 37 | 38 | This script will not update 1Password 8 because I have not found any good way to find the latest version. 39 | Therefore it will only do a first install of 1Password 8." 40 | 41 | exit 0 42 | 43 | fi 44 | 45 | URL='https://downloads.1password.com/mac/1Password.zip' 46 | 47 | FILENAME="${DOWNLOAD_DIR_ALTERNATE-$HOME/Downloads}/1PasswordInstalller.zip" 48 | 49 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 50 | 51 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 52 | 53 | EXIT="$?" 54 | 55 | ## exit 22 means 'the file was already fully downloaded' 56 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 57 | 58 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 59 | 60 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 61 | 62 | egrep -q '^Local sha256:$' "$FILENAME:r.txt" 2>/dev/null 63 | 64 | EXIT="$?" 65 | 66 | if [ "$EXIT" = "1" -o ! -e "$FILENAME:r.txt" ] 67 | then 68 | (cd "$FILENAME:h" ; \ 69 | echo "\n\nLocal sha256:" ; \ 70 | shasum -a 256 "$FILENAME:t" \ 71 | ) >>| "$FILENAME:r.txt" 72 | fi 73 | 74 | TEMPDIR=$(mktemp -d "${TMPDIR-/tmp/}${NAME-$0:r}-XXXXXXXX") 75 | 76 | ## make sure that the .zip is valid before we proceed 77 | (command unzip -l "$FILENAME" 2>&1 )>/dev/null 78 | 79 | EXIT="$?" 80 | 81 | if [ "$EXIT" = "0" ] 82 | then 83 | echo "$NAME: '$FILENAME' is a valid zip file." 84 | 85 | else 86 | echo "$NAME: '$FILENAME' is an invalid zip file (\$EXIT = $EXIT)" 87 | 88 | mv -fv "$FILENAME" "$TEMPDIR/" 89 | 90 | mv -fv "$FILENAME:r".* "$TEMPDIR/" 91 | 92 | exit 0 93 | 94 | fi 95 | 96 | ## unzip to a temporary directory 97 | UNZIP_TO=$(mktemp -d "${TEMPDIR}/${NAME}-XXXXXXXX") 98 | 99 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 100 | 101 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 102 | 103 | EXIT="$?" 104 | 105 | if [[ "$EXIT" == "0" ]] 106 | then 107 | echo "$NAME: Unzip successful to '$UNZIP_TO'" 108 | else 109 | # failed 110 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 111 | 112 | exit 1 113 | fi 114 | 115 | # Here we just launch the installer which will download and install the app from here 116 | open -a "${UNZIP_TO}/1Password Installer.app" 117 | 118 | exit 0 119 | #EOF 120 | -------------------------------------------------------------------------------- /di-backblaze.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install (but not update) Backblaze 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2018-10-06 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | ######################################################################################################## 17 | # 18 | # this section is old/outdated but I didn't want to get rid of it for future reference. 19 | # 20 | # mac_version="5.4.0.246" mac_url="%DEST_HOST%/api/install_backblaze?file=bzinstall-mac-5.4.0.246.zip" 21 | # 22 | # INFO=($(curl -sfLS 'https://secure.backblaze.com/api/clientversion.xml' | awk -F'"' '/mac_version/{print $2" "$4}')) 23 | # 24 | # LATEST_VERSION="$INFO[1]" 25 | # 26 | # URL=$(echo "$INFO[2]" | sed 's#%DEST_HOST%#https://secure.backblaze.com#g') 27 | 28 | INSTALL_TO="/Applications/Backblaze.app" 29 | 30 | URL='https://secure.backblaze.com/mac/install_backblaze.dmg' 31 | 32 | if [[ -e "$INSTALL_TO" ]] 33 | then 34 | 35 | echo "$NAME: This script will install, but not update, Backblaze." 36 | echo " Found '$INSTALL_TO'. Exiting." 37 | exit 0 38 | fi 39 | 40 | FILENAME="$HOME/Downloads/Backblaze.dmg" 41 | 42 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 43 | 44 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 45 | 46 | EXIT="$?" 47 | 48 | ## exit 22 means 'the file was already fully downloaded' 49 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 50 | 51 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 52 | 53 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 54 | 55 | echo "$NAME: Mounting $FILENAME:" 56 | 57 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 58 | | fgrep -A 1 'mount-point' \ 59 | | tail -1 \ 60 | | sed 's#.*##g ; s#.*##g') 61 | 62 | if [[ "$MNTPNT" == "" ]] 63 | then 64 | echo "$NAME: MNTPNT is empty" 65 | exit 1 66 | else 67 | echo "$NAME: MNTPNT is $MNTPNT" 68 | fi 69 | 70 | echo "$NAME: Opening '$MNTPNT/Backblaze Installer.app' ..." 71 | 72 | open -a "$MNTPNT/Backblaze Installer.app" 73 | 74 | exit 0 75 | #EOF 76 | -------------------------------------------------------------------------------- /di-chronosync.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install/update the latest version of ChronoSync 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-12-20 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | INSTALL_TO='/Applications/ChronoSync.app' 17 | 18 | URL='https://downloads.econtechnologies.com/updates/CS4_Download.dmg' 19 | 20 | FEED='https://www.econtechnologies.com/UC/updatecheck.php?prod=ChronoSync&vers=4.0&lang=en&plat=mac&os=10.14.1&hw=i64&req=1' 21 | 22 | INFO=$(curl -sfLS "$FEED" |\ 23 | sed 's#
#\ 24 | #g') 25 | 26 | LATEST_VERSION=$(echo "$INFO" | awk -F'=' '/^VERSION/{print $NF}') 27 | 28 | RELEASE_NOTES_URL=$(echo "$INFO" | awk -F'=' '/^NOTICE/{print $NF}') 29 | 30 | if [[ -e "$INSTALL_TO" ]] 31 | then 32 | 33 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 34 | 35 | autoload is-at-least 36 | 37 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 38 | 39 | VERSION_COMPARE="$?" 40 | 41 | if [ "$VERSION_COMPARE" = "0" ] 42 | then 43 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 44 | exit 0 45 | fi 46 | 47 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 48 | 49 | FIRST_INSTALL='no' 50 | 51 | else 52 | 53 | FIRST_INSTALL='yes' 54 | fi 55 | 56 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${${LATEST_VERSION}// /}.dmg" 57 | 58 | if (( $+commands[lynx] )) 59 | then 60 | 61 | lynx -dump -nomargins -width='10000' -assume_charset=UTF-8 -pseudo_inlines "$RELEASE_NOTES_URL" | tee "$FILENAME:r.txt" 62 | 63 | echo "\nVersion: ${LATEST_VERSION}\nSource: ${RELEASE_NOTES_URL}\nURL: $URL" | tee -a "$FILENAME:r.txt" 64 | 65 | fi 66 | 67 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 68 | 69 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 70 | 71 | EXIT="$?" 72 | 73 | ## exit 22 means 'the file was already fully downloaded' 74 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 75 | 76 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 77 | 78 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 79 | 80 | (cd "$FILENAME:h" ; echo "\nLocal sha256:" ; shasum -a 256 "$FILENAME:t" ) >>| "$FILENAME:r.txt" 81 | 82 | echo "$NAME: Mounting $FILENAME:" 83 | 84 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 85 | | fgrep -A 1 'mount-point' \ 86 | | tail -1 \ 87 | | sed 's#
.*##g ; s#.*##g') 88 | 89 | if [[ "$MNTPNT" == "" ]] 90 | then 91 | echo "$NAME: MNTPNT is empty" 92 | exit 1 93 | else 94 | echo "$NAME: MNTPNT is $MNTPNT" 95 | fi 96 | 97 | PKG=$(find "$MNTPNT" -maxdepth 1 -iname 'Install.pkg' -print) 98 | 99 | if [[ "$PKG" == "" ]] 100 | then 101 | echo "$NAME: No 'Install.pkg' found in '$MNTPNT'." >>/dev/stderr 102 | exit 1 103 | fi 104 | 105 | if (( $+commands[pkginstall.sh] )) 106 | then 107 | pkginstall.sh "$PKG" 108 | else 109 | sudo /usr/sbin/installer -verbose -pkg "$PKG" -dumplog -target / -lang en 2>&1 110 | fi 111 | 112 | EXIT="$?" 113 | 114 | if [[ "$EXIT" != "0" ]] 115 | then 116 | 117 | echo "$NAME: installation of '$PKG' failed (\$EXIT = $EXIT)." 118 | 119 | # Show the .pkg file at least, to draw their attention to it. 120 | open -R "$PKG" 121 | 122 | exit 1 123 | fi 124 | 125 | echo "$NAME: Unmounting $MNTPNT:" 126 | 127 | diskutil eject "$MNTPNT" 128 | 129 | exit 0 130 | #EOF 131 | -------------------------------------------------------------------------------- /di-cleantext.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Install the latest version of Clean Text 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-11-12 7 | # Verified: 2025-02-15 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | INSTALL_TO='/Applications/Clean Text.app' 17 | 18 | HOMEPAGE='https://www.apimac.com/mac/cleantext/' 19 | 20 | URL='https://www.apimac.com/download/CleanText.zip' 21 | 22 | if [[ -e "$INSTALL_TO" ]] 23 | then 24 | 25 | echo "$NAME: Sorry, I can't update Clean Text, I can only install it." 26 | exit 0 27 | 28 | 29 | ## why? Because this feed is useless and out of date, and there's 30 | ## no good way of finding the current version number 31 | # XML_FEED="https://www.apimac.com/version_checking/cleantext.xml" 32 | 33 | fi 34 | 35 | FILENAME="${DOWNLOAD_DIR_ALTERNATE-$HOME/Downloads}/${${INSTALL_TO:t:r}// /}.zip" 36 | 37 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 38 | 39 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 40 | 41 | EXIT="$?" 42 | 43 | ## exit 22 means 'the file was already fully downloaded' 44 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 45 | 46 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 47 | 48 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 49 | 50 | egrep -q '^Local sha256:$' "$FILENAME:r.txt" 2>/dev/null 51 | 52 | EXIT="$?" 53 | 54 | if [ "$EXIT" = "1" -o ! -e "$FILENAME:r.txt" ] 55 | then 56 | (cd "$FILENAME:h" ; \ 57 | echo "\n\nLocal sha256:" ; \ 58 | shasum -a 256 "$FILENAME:t" \ 59 | ) >>| "$FILENAME:r.txt" 60 | fi 61 | 62 | 63 | TEMPDIR=$(mktemp -d "${TMPDIR-/tmp/}${NAME-$0:r}-XXXXXXXX") 64 | 65 | ## make sure that the .zip is valid before we proceed 66 | (command unzip -l "$FILENAME" 2>&1 )>/dev/null 67 | 68 | EXIT="$?" 69 | 70 | if [ "$EXIT" = "0" ] 71 | then 72 | echo "$NAME: '$FILENAME' is a valid zip file." 73 | 74 | else 75 | echo "$NAME: '$FILENAME' is an invalid zip file (\$EXIT = $EXIT)" 76 | 77 | mv -fv "$FILENAME" "$TEMPDIR/" 78 | 79 | mv -fv "$FILENAME:r".* "$TEMPDIR/" 80 | 81 | exit 0 82 | 83 | fi 84 | 85 | ## unzip to a temporary directory 86 | UNZIP_TO=$(mktemp -d "${TEMPDIR}/${NAME}-XXXXXXXX") 87 | 88 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 89 | 90 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 91 | 92 | EXIT="$?" 93 | 94 | if [[ "$EXIT" == "0" ]] 95 | then 96 | echo "$NAME: Unzip successful" 97 | else 98 | # failed 99 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 100 | 101 | exit 1 102 | fi 103 | 104 | if [[ -e "$INSTALL_TO" ]] 105 | then 106 | 107 | pgrep -xq "$INSTALL_TO:t:r" \ 108 | && LAUNCH='yes' \ 109 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 110 | 111 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$TEMPDIR/'." 112 | 113 | mv -f "$INSTALL_TO" "$TEMPDIR/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 114 | 115 | EXIT="$?" 116 | 117 | if [[ "$EXIT" != "0" ]] 118 | then 119 | 120 | echo "$NAME: failed to move existing '$INSTALL_TO' to '$TEMPDIR'." 121 | 122 | exit 1 123 | fi 124 | fi 125 | 126 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 127 | 128 | # Move the file out of the folder 129 | mv -n "$UNZIP_TO/$INSTALL_TO:t" "$INSTALL_TO" 130 | 131 | EXIT="$?" 132 | 133 | if [[ "$EXIT" = "0" ]] 134 | then 135 | 136 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 137 | 138 | else 139 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 140 | 141 | exit 1 142 | fi 143 | 144 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 145 | 146 | exit 0 147 | #EOF 148 | -------------------------------------------------------------------------------- /di-expandrive.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and Install the latest version of ExpanDrive for Mac from 3 | # 4 | # From: Tj Luo.ma 5 | # Mail: luomat at gmail dot com 6 | # Web: http://RhymesWithDiploma.com 7 | # Date: 2015-07-30 8 | # Verified: 2025-02-24 9 | 10 | NAME="$0:t:r" 11 | 12 | INSTALL_TO='/Applications/ExpanDrive.app' 13 | 14 | # Do Not Use: http://updates.expandrive.com/apps/expandrive.xml 15 | 16 | XML_FEED='https://updates.expandrive.com/appcast/expandrive7.json?version=7.0.0' 17 | 18 | HOMEPAGE="https://www.expandrive.com" 19 | 20 | DOWNLOAD_PAGE="https://www.expandrive.com/download-expandrive/" 21 | 22 | SUMMARY="Access files in the cloud from Finder or Explorer without having to sync or use disk space. ExpanDrive mounts OneDrive, Google Drive, Dropbox, Box, Sharepoint, Amazon S3, FTP, SFTP and more as a Network Drive." 23 | 24 | if [[ -e "$HOME/.path" ]] 25 | then 26 | source "$HOME/.path" 27 | fi 28 | 29 | URL=$(curl -sfLS "$XML_FEED" | awk -F'"' '/url/{print $4}') 30 | 31 | LATEST_VERSION=$(echo "$URL" | awk -F'/' '/http/{print $7}' | tr '-' '.') 32 | 33 | # If any of these are blank, we should not continue 34 | if [ "$LATEST_VERSION" = "" -o "$URL" = "" ] 35 | then 36 | echo "$NAME: Error: bad data received:\nLATEST_VERSION: $LATEST_VERSION\nURL: $URL" 37 | exit 1 38 | fi 39 | 40 | if [[ -e "$INSTALL_TO" ]] 41 | then 42 | 43 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleVersion) 44 | 45 | autoload is-at-least 46 | 47 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 48 | 49 | VERSION_COMPARE="$?" 50 | 51 | if [ "$VERSION_COMPARE" = "0" ] 52 | then 53 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 54 | exit 0 55 | fi 56 | 57 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 58 | 59 | FIRST_INSTALL='no' 60 | 61 | else 62 | 63 | FIRST_INSTALL='yes' 64 | fi 65 | 66 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.zip" 67 | 68 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 69 | 70 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 71 | 72 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 73 | 74 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 75 | 76 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 77 | 78 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 79 | 80 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 81 | 82 | EXIT="$?" 83 | 84 | if [[ "$EXIT" == "0" ]] 85 | then 86 | echo "$NAME: Unzip successful" 87 | else 88 | # failed 89 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 90 | 91 | exit 1 92 | fi 93 | 94 | if [[ -e "$INSTALL_TO" ]] 95 | then 96 | echo "$NAME: Moving existing (old) \"$INSTALL_TO\" to \"$HOME/.Trash/\"." 97 | 98 | mv -f "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 99 | 100 | EXIT="$?" 101 | 102 | if [[ "$EXIT" != "0" ]] 103 | then 104 | 105 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 106 | 107 | exit 1 108 | fi 109 | fi 110 | 111 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 112 | 113 | # Move the file out of the folder 114 | mv -n "$UNZIP_TO/$INSTALL_TO:t" "$INSTALL_TO" 115 | 116 | EXIT="$?" 117 | 118 | if [[ "$EXIT" = "0" ]] 119 | then 120 | 121 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | else 124 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 125 | 126 | exit 1 127 | fi 128 | 129 | [[ "$FIRST_INSTALL" == "yes" ]] && echo "$NAME: Launching $INSTALL_TO:t:r" && open -a "$INSTALL_TO" 130 | 131 | exit 0 132 | # 133 | #EOF 134 | -------------------------------------------------------------------------------- /di-finereaderpro.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install the latest version of Fine Reader Pro 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-11-09 ; 2019-11-14 update ; 2020-01-31 ne URL and method of downloading 7 | # Verified: 2025-02-24 8 | 9 | 10 | # Chcek for Updates opens this page 11 | # https://pdf.abbyy.com/checkforupdates/?Product=FineReaderMac&Distributive=Retail&Revision=FSRR15000007037407926727&Language=en&PartNumber=1402.19&Target=CheckUpdate&Version=15.2&Revision=14&Build=1093332 12 | ####################################################################################### 13 | 14 | if [[ -e "$HOME/.path" ]] 15 | then 16 | source "$HOME/.path" 17 | fi 18 | 19 | NAME="$0:t:r" 20 | 21 | INSTALL_TO='/Applications/ABBYY FineReader PDF.app' 22 | 23 | if [[ -e "$INSTALL_TO" ]] 24 | then 25 | echo "$NAME Fatal error: '$INSTALL_TO' already exists.\n\tI can only install, not update." 26 | exit 0 27 | fi 28 | 29 | URL=$(curl -sfLS "https://www.abbyy.com/finereader-pdf-mac-downloads/" \ 30 | | tr ' ' '\012' \ 31 | | fgrep -i .dmg \ 32 | | sed 's#href="##g; s#"$##g' \ 33 | | head -1) 34 | 35 | FILENAME="$HOME/Downloads/FineReader.dmg" 36 | 37 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 38 | 39 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 40 | 41 | EXIT="$?" 42 | 43 | ## exit 22 means 'the file was already fully downloaded' 44 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 45 | 46 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 47 | 48 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 49 | 50 | echo "$NAME: Mounting $FILENAME:" 51 | 52 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 53 | | fgrep -A 1 'mount-point' \ 54 | | tail -1 \ 55 | | sed 's#.*##g ; s#.*##g') 56 | 57 | if [[ "$MNTPNT" == "" ]] 58 | then 59 | echo "$NAME: MNTPNT is empty" 60 | exit 1 61 | else 62 | echo "$NAME: MNTPNT is $MNTPNT" 63 | fi 64 | 65 | echo "$NAME: Installing '$MNTPNT/$INSTALL_TO:t' to '$INSTALL_TO': " 66 | 67 | ditto --noqtn -v "$MNTPNT/$INSTALL_TO:t" "$INSTALL_TO" 68 | 69 | EXIT="$?" 70 | 71 | if [[ "$EXIT" == "0" ]] 72 | then 73 | echo "$NAME: Successfully installed $INSTALL_TO" 74 | else 75 | echo "$NAME: ditto failed" 76 | 77 | exit 1 78 | fi 79 | 80 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 81 | 82 | echo -n "$NAME: Unmounting $MNTPNT: " && diskutil eject "$MNTPNT" 83 | 84 | exit 0 85 | 86 | # EOF -------------------------------------------------------------------------------- /di-flux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install Flux 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-10-28 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | INSTALL_TO='/Applications/Flux.app' 12 | 13 | HOMEPAGE="https://justgetflux.com" 14 | 15 | DOWNLOAD_PAGE="https://justgetflux.com/dlmac.html" 16 | 17 | SUMMARY="f.lux makes the color of your computer's display adapt to the time of day, warm at night and like sunlight during the day." 18 | 19 | XML_FEED='https://justgetflux.com/mac/macflux.xml' 20 | 21 | if [[ -e "$HOME/.path" ]] 22 | then 23 | source "$HOME/.path" 24 | fi 25 | 26 | LAUNCH='no' 27 | 28 | INFO=($(curl -sfL "$XML_FEED" \ 29 | | tr -s ' ' '\012' \ 30 | | egrep '^(url|sparkle:version)=' \ 31 | | head -2 \ 32 | | awk -F'"' '//{print $2}')) 33 | 34 | URL="$INFO[1]" 35 | 36 | LATEST_VERSION="$INFO[2]" 37 | 38 | # If any of these are blank, we should not continue 39 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 40 | then 41 | echo "$NAME: Error: bad data received: 42 | INFO: $INFO 43 | LATEST_VERSION: $LATEST_VERSION 44 | URL: $URL 45 | " 46 | 47 | exit 1 48 | fi 49 | 50 | if [[ -e "$INSTALL_TO" ]] 51 | then 52 | 53 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo '0'` 54 | 55 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 56 | then 57 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 58 | exit 0 59 | fi 60 | 61 | autoload is-at-least 62 | 63 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 64 | 65 | if [ "$?" = "0" ] 66 | then 67 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 68 | exit 0 69 | fi 70 | 71 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 72 | 73 | fi 74 | 75 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-$LATEST_VERSION.zip" 76 | 77 | if (( $+commands[lynx] )) 78 | then 79 | 80 | (curl -sfLS "$XML_FEED" \ 81 | | fgrep -v 'Most recent changes with links to updates.' \ 82 | | sed -e '1,//d; /<\/description>/,$d' -e 's#\]\]\>##g' -e 's#\<\!\[CDATA\[##g' \ 83 | | awk '/

/{i++}i==1' \ 84 | | lynx -dump -nomargins -width='10000' -assume_charset=UTF-8 -pseudo_inlines -stdin) \ 85 | | tee "$FILENAME:r.txt" 86 | 87 | fi 88 | 89 | echo "$NAME: Downloading $URL to $FILENAME" 90 | 91 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 92 | 93 | EXIT="$?" 94 | 95 | ## exit 22 means 'the file was already fully downloaded' 96 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 97 | 98 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 99 | 100 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 101 | 102 | pgrep Flux && LAUNCH='yes' && pkill Flux 103 | 104 | echo "$NAME: Installing $FILENAME to $INSTALL_TO:h/" 105 | 106 | ditto --noqtn -xk "$FILENAME" "$INSTALL_TO:h/" 107 | 108 | EXIT="$?" 109 | 110 | if [ "$EXIT" = "0" ] 111 | then 112 | 113 | echo "$NAME: Successfully installed/updated $INSTALL_TO" 114 | 115 | else 116 | echo "$NAME: ditto failed (\$EXIT = $EXIT)" 117 | 118 | exit 1 119 | fi 120 | 121 | [[ "$LAUNCH" = "yes" ]] && echo "$NAME: relaunching Flux" && open --background "$INSTALL_TO" 122 | 123 | exit 0 124 | # 125 | #EOF 126 | -------------------------------------------------------------------------------- /di-fork.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: https://git-fork.com 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-07 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | INSTALL_TO='/Applications/Fork.app' 17 | 18 | XML_FEED='https://git-fork.com/update/feed.xml' 19 | 20 | INFO=($(curl -sSfL "${XML_FEED}" \ 21 | | tr -s ' ' '\012' \ 22 | | egrep 'sparkle:version|url=' \ 23 | | head -2 \ 24 | | sort \ 25 | | awk -F'"' '/^/{print $2}')) 26 | 27 | # "Sparkle" will always come before "url" because of "sort" 28 | LATEST_VERSION="$INFO[1]" 29 | URL="$INFO[2]" 30 | 31 | # If any of these are blank, we cannot continue 32 | if [ "$INFO" = "" -o "$URL" = "" -o "$LATEST_VERSION" = "" ] 33 | then 34 | echo "$NAME: Error: bad data received: 35 | INFO: $INFO 36 | LATEST_VERSION: $LATEST_VERSION 37 | URL: $URL 38 | " 39 | 40 | exit 1 41 | fi 42 | 43 | if [[ -e "$INSTALL_TO" ]] 44 | then 45 | 46 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 47 | 48 | autoload is-at-least 49 | 50 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 51 | 52 | VERSION_COMPARE="$?" 53 | 54 | if [ "$VERSION_COMPARE" = "0" ] 55 | then 56 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 57 | exit 0 58 | fi 59 | 60 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 61 | 62 | FIRST_INSTALL='no' 63 | 64 | else 65 | 66 | FIRST_INSTALL='yes' 67 | fi 68 | 69 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.dmg" 70 | 71 | if (( $+commands[lynx] )) 72 | then 73 | 74 | ( echo "Fork ${LATEST_VERSION}\n\n${URL}\n$XML_FEED\n" \ 75 | ; curl -sfLS "$XML_FEED" \ 76 | | awk '//{i++}i==2' \ 77 | | sed -e '/<\/description>/,$d' -e 's#\<\!\[CDATA\[##g' -e 's#]]\>##g' \ 78 | | lynx -dump -nomargins -width='10000' -assume_charset=UTF-8 -pseudo_inlines -nonumbers -nolist -stdin ) \ 79 | | tee "$FILENAME:r.txt" 80 | 81 | fi 82 | 83 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 84 | 85 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 86 | 87 | EXIT="$?" 88 | 89 | ## exit 22 means 'the file was already fully downloaded' 90 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 91 | 92 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 93 | 94 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 95 | 96 | echo "$NAME: Mounting $FILENAME:" 97 | 98 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 99 | | fgrep -A 1 'mount-point' \ 100 | | tail -1 \ 101 | | sed 's#.*##g ; s#.*##g') 102 | 103 | if [[ "$MNTPNT" == "" ]] 104 | then 105 | echo "$NAME: MNTPNT is empty" 106 | exit 1 107 | else 108 | echo "$NAME: MNTPNT is $MNTPNT" 109 | fi 110 | 111 | if [[ -e "$INSTALL_TO" ]] 112 | then 113 | # Quit app, if running 114 | pgrep -xq "$INSTALL_TO:t:r" \ 115 | && LAUNCH='yes' \ 116 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 117 | 118 | # move installed version to trash 119 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.${INSTALLED_VERSION}_${INSTALLED_BUILD}.app" 120 | fi 121 | 122 | echo "$NAME: Installing '$MNTPNT/$INSTALL_TO:t' to '$INSTALL_TO': " 123 | 124 | ditto --noqtn -v "$MNTPNT/$INSTALL_TO:t" "$INSTALL_TO" 125 | 126 | EXIT="$?" 127 | 128 | if [[ "$EXIT" == "0" ]] 129 | then 130 | echo "$NAME: Successfully installed $INSTALL_TO" 131 | else 132 | echo "$NAME: ditto failed" 133 | 134 | exit 1 135 | fi 136 | 137 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 138 | 139 | echo -n "$NAME: Unmounting $MNTPNT: " && diskutil eject "$MNTPNT" 140 | 141 | exit 0 142 | #EOF 143 | -------------------------------------------------------------------------------- /di-googlechrome.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install (but not update) the latest version Google Chrome 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-08-07; updated to just download on 2025-02-15 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | # must be in /Applications/ for 1Password 17 | INSTALL_TO='/Applications/Google Chrome.app' 18 | 19 | if [[ -e "$INSTALL_TO" ]] 20 | then 21 | 22 | echo "$NAME: Fatal error: Google Chrome is already installed. 23 | This script can only install, not update, Google Chrome." 24 | 25 | exit 0 26 | 27 | fi 28 | 29 | # 2021-01-19 - this is a universal (Intel/Apple Silicon) build 30 | URL='https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg' 31 | 32 | # There is no way, that I know of, to check the current version, 33 | # so I just download the current version 34 | 35 | # No version number is available, we just want to know what this file is 36 | FILENAME="$HOME/Downloads/GoogleChrome.dmg" 37 | 38 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 39 | 40 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 41 | 42 | EXIT="$?" 43 | 44 | ## exit 22 means 'the file was already fully downloaded' 45 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 46 | 47 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 48 | 49 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 50 | 51 | echo "$NAME: Mounting $FILENAME:" 52 | 53 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 54 | | fgrep -A 1 'mount-point' \ 55 | | tail -1 \ 56 | | sed 's#.*##g ; s#.*##g') 57 | 58 | if [[ "$MNTPNT" == "" ]] 59 | then 60 | echo "$NAME: MNTPNT is empty" 61 | exit 1 62 | else 63 | echo "$NAME: MNTPNT is $MNTPNT" 64 | fi 65 | 66 | echo "$NAME: Installing '$MNTPNT/$INSTALL_TO:t' to '$INSTALL_TO': " 67 | 68 | ditto --noqtn -v "$MNTPNT/$INSTALL_TO:t" "$INSTALL_TO" 69 | 70 | EXIT="$?" 71 | 72 | if [[ "$EXIT" == "0" ]] 73 | then 74 | echo "$NAME: Successfully installed $INSTALL_TO" 75 | else 76 | echo "$NAME: ditto failed" 77 | 78 | exit 1 79 | fi 80 | 81 | echo -n "$NAME: Unmounting $MNTPNT: " && diskutil eject "$MNTPNT" 82 | 83 | exit 0 84 | #EOF 85 | -------------------------------------------------------------------------------- /di-grammarly.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install the latest version of Grammarly Desktop 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-08-03 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | INSTALL_TO='/Applications/Grammarly Desktop.app' 17 | 18 | XML_FEED='https://download-mac.grammarly.com/appcast.xml' 19 | 20 | INFO=$(curl -sfLS "$XML_FEED" | tr '\012' ' ') 21 | 22 | URL=$(echo "$INFO" | sed 's#.*enclosure url="##g ; s#" .*##g') 23 | 24 | LATEST_VERSION=$(echo "$INFO" | sed 's#.*sparkle:shortVersionString="##g ; s#" .*##g') 25 | 26 | # If any of these are blank, we cannot continue 27 | if [ "$INFO" = "" -o "$URL" = "" -o "$LATEST_VERSION" = "" ] 28 | then 29 | echo "$NAME: Error: bad data received: 30 | INFO: $INFO 31 | LATEST_VERSION: $LATEST_VERSION 32 | URL: $URL 33 | " 34 | 35 | exit 1 36 | fi 37 | 38 | if [[ -e "$INSTALL_TO" ]] 39 | then 40 | 41 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 42 | 43 | autoload is-at-least 44 | 45 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 46 | 47 | VERSION_COMPARE="$?" 48 | 49 | if [ "$VERSION_COMPARE" = "0" ] 50 | then 51 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 52 | exit 0 53 | fi 54 | 55 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 56 | 57 | FIRST_INSTALL='no' 58 | 59 | if [[ ! -w "$INSTALL_TO" ]] 60 | then 61 | echo "$NAME: '$INSTALL_TO' exists, but you do not have 'write' access to it, therefore you cannot update it." >>/dev/stderr 62 | 63 | exit 2 64 | fi 65 | 66 | else 67 | 68 | FIRST_INSTALL='yes' 69 | fi 70 | 71 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.dmg" 72 | 73 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 74 | 75 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 76 | 77 | EXIT="$?" 78 | 79 | ## exit 22 means 'the file was already fully downloaded' 80 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 81 | 82 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 83 | 84 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 85 | 86 | (cd "$FILENAME:h" ; echo "\nLocal sha256:" ; shasum -a 256 "$FILENAME:t" ) >>| "$FILENAME:r.txt" 87 | 88 | echo "$NAME: Mounting $FILENAME:" 89 | 90 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 91 | | fgrep -A 1 'mount-point' \ 92 | | tail -1 \ 93 | | sed 's#.*##g ; s#.*##g') 94 | 95 | if [[ "$MNTPNT" == "" ]] 96 | then 97 | echo "$NAME: MNTPNT is empty" 98 | exit 1 99 | else 100 | echo "$NAME: MNTPNT is $MNTPNT" 101 | fi 102 | 103 | if [[ -e "$INSTALL_TO" ]] 104 | then 105 | # Quit app, if running 106 | pgrep -xq "$INSTALL_TO:t:r" \ 107 | && LAUNCH='yes' \ 108 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 109 | 110 | # move installed version to trash 111 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.${INSTALLED_VERSION}_${INSTALLED_BUILD}.app" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" != "0" ]] 116 | then 117 | 118 | echo "$NAME: failed to move '$INSTALL_TO' to Trash. ('mv' \$EXIT = $EXIT)" 119 | 120 | exit 1 121 | fi 122 | 123 | fi 124 | 125 | echo "$NAME: Launching '$MNTPNT/Grammarly Installer.app... " 126 | 127 | # Can't do anything more than this 128 | # opening it will install the app and prompt for accessibility permissions 129 | open "$MNTPNT/Grammarly Installer.app" 130 | 131 | exit 0 132 | #EOF 133 | -------------------------------------------------------------------------------- /di-ibettercharge.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download iBetterCharge from https://softorino.com/ibettercharge/ 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-14 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | INSTALL_TO='/Applications/iBetterCharge.app' 17 | 18 | INFO=($(curl -sfLS "https://updates.devmate.com/com.softorino.iBetterCharge.xml" \ 19 | | tr ' ' '\012' \ 20 | | egrep '|url=|sparkle:version=' \ 21 | | head -3 \ 22 | | sed 's#.*##g; s###g; s#url="##g ; s#"$##g ; s#sparkle:version="##g')) 23 | 24 | RELEASE_NOTES_URL="$INFO[1]" 25 | URL="$INFO[2]" 26 | LATEST_VERSION="$INFO[3]" 27 | 28 | if [[ -e "$INSTALL_TO" ]] 29 | then 30 | 31 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 32 | 33 | autoload is-at-least 34 | 35 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 36 | 37 | VERSION_COMPARE="$?" 38 | 39 | if [ "$VERSION_COMPARE" = "0" ] 40 | then 41 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 42 | exit 0 43 | fi 44 | 45 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 46 | 47 | FIRST_INSTALL='no' 48 | 49 | else 50 | 51 | FIRST_INSTALL='yes' 52 | fi 53 | 54 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 55 | 56 | if (( $+commands[lynx] )) 57 | then 58 | 59 | curl -sfLS "$RELEASE_NOTES_URL" >| "$FILENAME:r.html" 60 | 61 | ( lynx -dump -nomargins -width='150' -assume_charset=UTF-8 -pseudo_inlines -nonumbers "$RELEASE_NOTES_URL" \ 62 | | uniq \ 63 | ) | tee "$FILENAME:r.txt" 64 | 65 | fi 66 | 67 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 68 | 69 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 70 | 71 | EXIT="$?" 72 | 73 | ## exit 22 means 'the file was already fully downloaded' 74 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 75 | 76 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 77 | 78 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 79 | 80 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 81 | 82 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 83 | 84 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 85 | 86 | EXIT="$?" 87 | 88 | if [[ "$EXIT" == "0" ]] 89 | then 90 | echo "$NAME: Unzip successful" 91 | else 92 | # failed 93 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 94 | 95 | exit 1 96 | fi 97 | 98 | if [[ -e "$INSTALL_TO" ]] 99 | then 100 | 101 | pgrep -xq "$INSTALL_TO:t:r" \ 102 | && LAUNCH='yes' \ 103 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 104 | 105 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 106 | 107 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 108 | 109 | EXIT="$?" 110 | 111 | if [[ "$EXIT" != "0" ]] 112 | then 113 | 114 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 115 | 116 | exit 1 117 | fi 118 | fi 119 | 120 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 121 | 122 | # Move the file out of the folder 123 | mv -vn "$UNZIP_TO/$INSTALL_TO:t" "$INSTALL_TO" 124 | 125 | EXIT="$?" 126 | 127 | if [[ "$EXIT" = "0" ]] 128 | then 129 | 130 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 131 | 132 | else 133 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 134 | 135 | exit 1 136 | fi 137 | 138 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 139 | 140 | exit 0 141 | #EOF 142 | -------------------------------------------------------------------------------- /di-jumpdesktopconnect.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install/update the latest version of Jump Desktop Connect 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-10-06 7 | # Verified: 2025-02-15 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | XML_FEED='https://s3.amazonaws.com/jumpdesktop.com/downloads/connect/connect-mac.xml' 17 | 18 | # This is a .pkg installer so it cannot be changed 19 | INSTALL_TO='/Applications/Jump Desktop Connect.app' 20 | 21 | INFO=$(curl -sfLS "$XML_FEED" | tr -s '\t|\012' ' ') 22 | 23 | URL=$(echo "$INFO" | sed 's#.* ##g ; s# .*##g') 33 | ## 34 | ##################################################################################################################### 35 | 36 | if [[ -e "$INSTALL_TO" ]] 37 | then 38 | 39 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 40 | 41 | INSTALLED_BUILD=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleVersion) 42 | 43 | autoload is-at-least 44 | 45 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 46 | 47 | VERSION_COMPARE="$?" 48 | 49 | is-at-least "$LATEST_BUILD" "$INSTALLED_BUILD" 50 | 51 | BUILD_COMPARE="$?" 52 | 53 | if [ "$VERSION_COMPARE" = "0" -a "$BUILD_COMPARE" = "0" ] 54 | then 55 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION/$INSTALLED_BUILD)" 56 | exit 0 57 | fi 58 | 59 | echo "$NAME: Outdated: $INSTALLED_VERSION/$INSTALLED_BUILD vs $LATEST_VERSION/$LATEST_BUILD" 60 | 61 | FIRST_INSTALL='no' 62 | 63 | else 64 | 65 | FIRST_INSTALL='yes' 66 | fi 67 | 68 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}_${LATEST_BUILD}.dmg" 69 | 70 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 71 | 72 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 73 | 74 | EXIT="$?" 75 | 76 | ## exit 22 means 'the file was already fully downloaded' 77 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 78 | 79 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 80 | 81 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 82 | 83 | (cd "$FILENAME:h" ; echo "\nLocal sha256:" ; shasum -a 256 "$FILENAME:t" ) >>| "$FILENAME:r.txt" 84 | 85 | echo "$NAME: Mounting $FILENAME:" 86 | 87 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 88 | | fgrep -A 1 'mount-point' \ 89 | | tail -1 \ 90 | | sed 's#.*##g ; s#.*##g') 91 | 92 | if [[ "$MNTPNT" == "" ]] 93 | then 94 | echo "$NAME: MNTPNT is empty" 95 | exit 1 96 | else 97 | echo "$NAME: MNTPNT is $MNTPNT" 98 | fi 99 | 100 | PKG="$MNTPNT/.jdc.sparkle_guided.pkg" 101 | 102 | if [[ ! -e "$PKG" ]] 103 | then 104 | 105 | echo "$NAME: No file found at '$PKG'." 106 | exit 1 107 | 108 | fi 109 | 110 | if (( $+commands[pkginstall.sh] )) 111 | then 112 | 113 | pkginstall.sh "$PKG" 114 | 115 | else 116 | 117 | sudo /usr/sbin/installer -verbose -pkg "$PKG" -dumplog -target / -lang en || open -R "$PKG" 118 | 119 | fi 120 | 121 | echo -n "$NAME: Unmounting $MNTPNT: " && diskutil eject "$MNTPNT" 122 | 123 | exit 0 124 | #EOF 125 | -------------------------------------------------------------------------------- /di-logos.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download latest version of Logos Bible study software 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2018-08-20 7 | # Verified: 2025-03-03 8 | 9 | [[ -e "$HOME/.path" ]] && source "$HOME/.path" 10 | 11 | [[ -e "$HOME/.config/di/defaults.sh" ]] && source "$HOME/.config/di/defaults.sh" 12 | 13 | INSTALL_TO="${INSTALL_DIR_ALTERNATE-/Applications}/Logos.app" 14 | 15 | # No RELEASE_NOTES_URL available in XML_FEED or elsewhere, as far as I can find 16 | # XML_FEED='https://clientservices.logos.com/update/v1/feed/logos9-mac/stable.xml' 17 | 18 | XML_FEED='https://clientservices.logos.com/update/v1/feed/logos10-mac/stable.xml' 19 | 20 | NAME="$0:t:r" 21 | 22 | HOMEPAGE="https://www.logos.com" 23 | 24 | DOWNLOAD_PAGE=$(curl -sfLS "$XML_FEED" \ 25 | | sed 's#\.dmg.*#.dmg# ; s#.*https://downloads.logoscdn.com#https://downloads.logoscdn.com#g') 26 | 27 | SUMMARY="Logos helps you discover, understand, and share more of the biblical insights you crave." 28 | 29 | INFO=($(curl -sfLS "$XML_FEED" | sed 's#><#>\ 30 | <#g' | awk '/' \ 32 | | sed -e 's#.*http#http#g' -e 's#.dmg.*#.dmg#g' -e 's###g' -e 's###g')) 33 | 34 | URL="$INFO[1]" 35 | 36 | LATEST_VERSION="$INFO[2]" 37 | 38 | # If any of these are blank, we should not continue 39 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 40 | then 41 | echo "$NAME: Error: bad data received: 42 | INFO: $INFO 43 | LATEST_VERSION: $LATEST_VERSION 44 | URL: $URL 45 | " 46 | 47 | exit 1 48 | fi 49 | 50 | if [[ -e "$INSTALL_TO" ]] 51 | then 52 | 53 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo '0'` 54 | 55 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 56 | then 57 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION) $ASTERISK" 58 | exit 0 59 | fi 60 | 61 | autoload is-at-least 62 | 63 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 64 | 65 | if [ "$?" = "0" ] 66 | then 67 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 68 | exit 0 69 | fi 70 | 71 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 72 | 73 | fi 74 | 75 | FILENAME="$HOME/Downloads/Logos-${LATEST_VERSION}.dmg" 76 | 77 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 78 | 79 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 80 | 81 | EXIT="$?" 82 | 83 | ## exit 22 means 'the file was already fully downloaded' 84 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download failed (EXIT = $EXIT)" && exit 0 85 | 86 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 87 | | fgrep -A 1 'mount-point' \ 88 | | tail -1 \ 89 | | sed 's#.*##g ; s#.*##g') 90 | 91 | if [[ "$MNTPNT" == "" ]] 92 | then 93 | echo "$NAME: MNTPNT is empty" 94 | exit 1 95 | fi 96 | 97 | if [ -e "$INSTALL_TO" ] 98 | then 99 | # Quit app, if running 100 | pgrep -xq "Logos" \ 101 | && LAUNCH='yes' \ 102 | && osascript -e 'tell application "Logos" to quit' 103 | 104 | # move installed version to trash 105 | mv -vf "$INSTALL_TO" "$HOME/.Trash/Logos.$INSTALLED_VERSION.app" 106 | fi 107 | 108 | echo "$NAME: Installing $MNTPNT/Logos.app to $INSTALL_TO" 109 | 110 | ditto --noqtn -v "$MNTPNT/Logos.app" "$INSTALL_TO" 111 | 112 | EXIT="$?" 113 | 114 | if [ "$EXIT" = "0" ] 115 | then 116 | 117 | echo "$NAME: Installed $LATEST_VERSION to $INSTALL_TO" 118 | 119 | else 120 | echo "$NAME: ditto failed (\$EXIT = $EXIT)" 121 | 122 | exit 1 123 | fi 124 | 125 | diskutil eject "$MNTPNT" 126 | 127 | [[ "$LAUNCH" == "yes" ]] && open "$INSTALL_TO" 128 | 129 | exit 0 130 | #EOF 131 | 132 | -------------------------------------------------------------------------------- /di-m4vgear.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install the latest version of m4vgear 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-10-29 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | INSTALL_TO='/Applications/M4VGear.app' 12 | 13 | HOMEPAGE="http://www.m4vgear.com/" 14 | 15 | DOWNLOAD_PAGE="https://www.m4vgear.com/m4vgear.dmg" 16 | 17 | SUMMARY="Strip DRM from purchased iTunes movies and TV shows." 18 | 19 | XML_FEED="http://www.m4vgear.com/feed-m4vgear.xml" 20 | 21 | if [[ -e "$HOME/.path" ]] 22 | then 23 | source "$HOME/.path" 24 | fi 25 | 26 | INFO=($(curl -sfL "$XML_FEED" | tr -s ' ' '\012' | egrep "^url=|sparkle:version=" | awk -F'"' '//{print $2}')) 27 | 28 | URL="$INFO[1]" 29 | 30 | LATEST_VERSION="$INFO[2]" 31 | 32 | # If any of these are blank, we should not continue 33 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 34 | then 35 | echo "$NAME: Error: bad data received: 36 | INFO: $INFO 37 | LATEST_VERSION: $LATEST_VERSION 38 | URL: $URL 39 | " 40 | 41 | exit 1 42 | fi 43 | 44 | if [[ -e "$INSTALL_TO" ]] 45 | then 46 | 47 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleVersion 2>/dev/null || echo '0'` 48 | 49 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 50 | then 51 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 52 | exit 0 53 | fi 54 | 55 | autoload is-at-least 56 | 57 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 58 | 59 | if [ "$?" = "0" ] 60 | then 61 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 62 | exit 0 63 | fi 64 | 65 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 66 | 67 | fi 68 | 69 | RELEASE_NOTES_URL="$XML_FEED" 70 | 71 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-$LATEST_VERSION.dmg" 72 | 73 | (echo -n "$NAME: Release Notes for " ; 74 | curl -sfL "$RELEASE_NOTES_URL" \ 75 | | perl -p -e 's//\n\n/ ; s/<\/description>/\n<\/description>\n/' \ 76 | | sed '1,//d; /<\/description>/,$d' ; 77 | echo "\nSource: XML_FEED <$RELEASE_NOTES_URL>" ) | tee "$FILENAME:r.txt" 78 | 79 | echo "$NAME: Downloading $URL to $FILENAME" 80 | 81 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 82 | 83 | EXIT="$?" 84 | 85 | ## exit 22 means 'the file was already fully downloaded' 86 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 87 | 88 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 89 | 90 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 91 | 92 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 93 | | fgrep -A 1 'mount-point' \ 94 | | tail -1 \ 95 | | sed 's#.*##g ; s#.*##g') 96 | 97 | 98 | if [ -e "$INSTALL_TO" ] 99 | then 100 | 101 | # move installed version to trash 102 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 103 | fi 104 | 105 | echo "$NAME: Installing $FILENAME to $INSTALL_TO" 106 | 107 | ditto --noqtn "$MNTPNT/M4VGear.app" "$INSTALL_TO" 108 | 109 | 110 | EXIT="$?" 111 | 112 | if [ "$EXIT" = "0" ] 113 | then 114 | 115 | echo "$NAME: Installation successful" 116 | 117 | else 118 | echo "$NAME: ditto failed (\$EXIT = $EXIT)" 119 | 120 | exit 1 121 | fi 122 | 123 | 124 | if (( $+commands[unmount.sh] )) 125 | then 126 | 127 | unmount.sh "$MNTPNT" 128 | 129 | else 130 | diskutil eject "$MNTPNT" 131 | 132 | fi 133 | 134 | exit 0 135 | #EOF 136 | -------------------------------------------------------------------------------- /di-mkvtoolnix.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install latest version of MKVToolNix.app 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-23 7 | # Verified: 2025-03-01 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | INSTALL_TO='/Applications/MKVToolNix.app' 17 | 18 | REMOTE_FILENAME=$(curl -sfLS "https://mkvtoolnix.download/macos/" \ 19 | | sed 's#><#>\ 20 | <#g' \ 21 | | fgrep .dmg \ 22 | | tail -1 \ 23 | | sed 's#.*">##g ; s###g') 24 | 25 | URL="https://mkvtoolnix.download/macos/$REMOTE_FILENAME" 26 | 27 | LATEST_VERSION=$(echo "$REMOTE_FILENAME:t:r" | tr -dc '[0-9]\.') 28 | 29 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.dmg" 30 | 31 | RELEASE_NOTES_URL="https://mkvtoolnix.download/doc/NEWS.md" 32 | 33 | if [[ -e "$INSTALL_TO" ]] 34 | then 35 | 36 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 37 | 38 | autoload is-at-least 39 | 40 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 41 | 42 | VERSION_COMPARE="$?" 43 | 44 | if [ "$VERSION_COMPARE" = "0" ] 45 | then 46 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 47 | exit 0 48 | fi 49 | 50 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 51 | 52 | FIRST_INSTALL='no' 53 | 54 | else 55 | 56 | FIRST_INSTALL='yes' 57 | fi 58 | 59 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 60 | 61 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 62 | 63 | EXIT="$?" 64 | 65 | ## exit 22 means 'the file was already fully downloaded' 66 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 67 | 68 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 69 | 70 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 71 | 72 | (curl -sfLS "$RELEASE_NOTES_URL" | awk '/^# Version/{i++}i==1' ) | tee "$FILENAME:r.txt" 73 | 74 | (cd "$FILENAME:h" ; echo "\n\nURL:\t${URL}\nLocal sha256:" ; shasum -a 256 "$FILENAME:t" ) >>| "$FILENAME:r.txt" 75 | 76 | echo "$NAME: Mounting $FILENAME:" 77 | 78 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 79 | | fgrep -A 1 'mount-point' \ 80 | | tail -1 \ 81 | | sed 's#.*##g ; s#.*##g') 82 | 83 | if [[ "$MNTPNT" == "" ]] 84 | then 85 | echo "$NAME: MNTPNT is empty" 86 | exit 1 87 | else 88 | echo "$NAME: MNTPNT is $MNTPNT" 89 | fi 90 | 91 | if [[ -e "$INSTALL_TO" ]] 92 | then 93 | # Quit app, if running 94 | pgrep -xq "$INSTALL_TO:t:r" \ 95 | && LAUNCH='yes' \ 96 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 97 | 98 | # move installed version to trash 99 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.${INSTALLED_VERSION}_${INSTALLED_BUILD}.app" 100 | fi 101 | 102 | MNT_APP=$(find "$MNTPNT" -maxdepth 1 -iname '*.app' -print | head -1) 103 | 104 | if [[ "$MNT_APP" == "" ]] 105 | then 106 | echo "$NAME: '$MNT_APP' is empty" 107 | exit 1 108 | fi 109 | 110 | echo "$NAME: Installing '$MNT_APP' to '$INSTALL_TO': " 111 | 112 | ditto --noqtn -v "$MNT_APP" "$INSTALL_TO" 113 | 114 | EXIT="$?" 115 | 116 | if [[ "$EXIT" == "0" ]] 117 | then 118 | echo "$NAME: Successfully installed $INSTALL_TO" 119 | else 120 | echo "$NAME: ditto failed" 121 | 122 | exit 1 123 | fi 124 | 125 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 126 | 127 | echo -n "$NAME: Unmounting $MNTPNT: " && diskutil eject "$MNTPNT" 128 | 129 | exit 0 130 | #EOF 131 | -------------------------------------------------------------------------------- /di-monolingual.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install the latest version of Monolingual 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2016-05-29 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | INSTALL_TO='/Applications/Monolingual.app' 12 | 13 | XML_FEED='https://ingmarstein.github.io/Monolingual/appcast.xml' 14 | 15 | HOMEPAGE="https://ingmarstein.github.io/Monolingual/" 16 | 17 | DOWNLOAD_PAGE="https://github.com/IngmarStein/Monolingual/releases" 18 | 19 | SUMMARY="Monolingual is a program for removing unnecessary language resources from macOS, in order to reclaim several hundred megabytes of disk space." 20 | 21 | if [[ -e "$HOME/.path" ]] 22 | then 23 | source "$HOME/.path" 24 | fi 25 | 26 | # no other version info in feed 27 | INFO=($(curl -sfL "$XML_FEED" \ 28 | | tr -s ' ' '\012' \ 29 | | egrep 'sparkle:version=|url=' \ 30 | | head -2 \ 31 | | sort \ 32 | | awk -F'"' '/^/{print $2}')) 33 | 34 | # "Sparkle" will always come before "url" because of "sort" 35 | LATEST_VERSION="$INFO[1]" 36 | URL="$INFO[2]" 37 | 38 | # If any of these are blank, we should not continue 39 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 40 | then 41 | echo "$NAME: Error: bad data received:\nINFO: $INFO\nLATEST_VERSION: $LATEST_VERSION\nURL: $URL" 42 | exit 1 43 | fi 44 | 45 | if [[ -e "$INSTALL_TO" ]] 46 | then 47 | 48 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 49 | 50 | autoload is-at-least 51 | 52 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 53 | 54 | VERSION_COMPARE="$?" 55 | 56 | if [ "$VERSION_COMPARE" = "0" ] 57 | then 58 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 59 | exit 0 60 | fi 61 | 62 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 63 | 64 | FIRST_INSTALL='no' 65 | 66 | else 67 | 68 | FIRST_INSTALL='yes' 69 | fi 70 | 71 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.tbz2" 72 | 73 | if (( $+commands[lynx] )) 74 | then 75 | 76 | RELEASE_NOTES_URL="$XML_FEED" 77 | 78 | (echo -n "$NAME: Release Notes for $INSTALL_TO:t:r " ; 79 | curl -sfLS $XML_FEED \ 80 | | sed '1,//d; /<\/description>/,$d ; s###g ;s###g ; s#<\!\[CDATA\[##; s#\]\]>##g' \ 81 | | lynx -dump -nomargins -width='10000' -assume_charset=UTF-8 -pseudo_inlines -stdin ; 82 | echo "\nSource: XML_FEED <$RELEASE_NOTES_URL>" ) | tee "$FILENAME:r.txt" 83 | 84 | fi 85 | 86 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 87 | 88 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 89 | 90 | EXIT="$?" 91 | 92 | ## exit 22 means 'the file was already fully downloaded' 93 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 94 | 95 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 96 | 97 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 98 | 99 | if [ -e "$INSTALL_TO" ] 100 | then 101 | # Quit app, if running 102 | pgrep -xq "$INSTALL_TO:t:r" \ 103 | && LAUNCH='yes' \ 104 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 105 | 106 | # move installed version to trash 107 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 108 | fi 109 | 110 | echo "$NAME: Unpacking $FILENAME to $INSTALL_TO:h" 111 | 112 | tar -x -C "$INSTALL_TO:h" -j -f "$FILENAME" 113 | 114 | EXIT="$?" 115 | 116 | if [[ "$EXIT" == "0" ]] 117 | then 118 | 119 | echo "$NAME: Installation success." 120 | 121 | else 122 | echo "$NAME: 'tar' failed (\$EXIT = $EXIT)" 123 | 124 | exit 1 125 | fi 126 | 127 | exit 0 128 | #EOF 129 | -------------------------------------------------------------------------------- /di-powermanager.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install/update version 5 of Power Manager 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-08-13 7 | # Verified: 2025-02-13 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | INSTALL_TO='/Applications/Power Manager.app' 17 | 18 | XML_FEED='https://version.dssw.co.uk/powermanager/mac' 19 | 20 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.${TIME}.$$.$RANDOM.xml" 21 | 22 | curl -sfLS "$XML_FEED" >| "$TEMPFILE" 23 | 24 | INFO=($(cat "$TEMPFILE" \ 25 | | tr ' ' '\012' \ 26 | | egrep '^(url|sparkle:shortVersionString|sparkle:version)=' \ 27 | | sort \ 28 | | awk -F'"' '//{print $2}')) 29 | 30 | LATEST_VERSION="$INFO[1]" 31 | 32 | LATEST_BUILD="$INFO[2]" 33 | 34 | URL="$INFO[3]" 35 | 36 | # If any of these are blank, we cannot continue 37 | if [ "$INFO" = "" -o "$LATEST_BUILD" = "" -o "$URL" = "" -o "$LATEST_VERSION" = "" ] 38 | then 39 | echo "$NAME: Error: bad data received: 40 | INFO: $INFO 41 | LATEST_VERSION: $LATEST_VERSION 42 | LATEST_BUILD: $LATEST_BUILD 43 | URL: $URL 44 | " 45 | 46 | exit 1 47 | fi 48 | 49 | if [[ -e "$INSTALL_TO" ]] 50 | then 51 | 52 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 53 | 54 | INSTALLED_BUILD=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleVersion) 55 | 56 | autoload is-at-least 57 | 58 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 59 | 60 | VERSION_COMPARE="$?" 61 | 62 | is-at-least "$LATEST_BUILD" "$INSTALLED_BUILD" 63 | 64 | BUILD_COMPARE="$?" 65 | 66 | if [ "$VERSION_COMPARE" = "0" -a "$BUILD_COMPARE" = "0" ] 67 | then 68 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION/$INSTALLED_BUILD)" 69 | exit 0 70 | fi 71 | 72 | echo "$NAME: Outdated: $INSTALLED_VERSION/$INSTALLED_BUILD vs $LATEST_VERSION/$LATEST_BUILD" 73 | 74 | FIRST_INSTALL='no' 75 | 76 | else 77 | 78 | FIRST_INSTALL='yes' 79 | fi 80 | 81 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}_${LATEST_BUILD}.pkg" 82 | 83 | if (( $+commands[lynx] )) 84 | then 85 | 86 | (cat "$TEMPFILE" \ 87 | | tr -s ' |\012|\t' ' ' \ 88 | | sed 's#.*CDATA\[##g ; s#\]\].*##g' \ 89 | | lynx -dump -nomargins -width='10000' -assume_charset=UTF-8 -pseudo_inlines -stdin ) \ 90 | | tee "$FILENAME:r.txt" 91 | 92 | fi 93 | 94 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 95 | 96 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 97 | 98 | EXIT="$?" 99 | 100 | ## exit 22 means 'the file was already fully downloaded' 101 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 102 | 103 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 104 | 105 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 106 | 107 | (cd "$FILENAME:h" ; echo "\nURL: $URL\n\nLocal sha256:" ; shasum -a 256 "$FILENAME:t" ) >>| "$FILENAME:r.txt" 108 | 109 | MIN_REQUIRED='10.12' 110 | 111 | OS_VER=$(sw_vers -productVersion) 112 | 113 | autoload is-at-least 114 | 115 | is-at-least "$MIN_REQUIRED" "$OS_VER" 116 | 117 | EXIT="$?" 118 | 119 | if [[ "$EXIT" = "1" ]] 120 | then 121 | 122 | echo "$NAME: '$INSTALL_TO:t' requires '$MIN_REQUIRED' but this Mac is running '$OS_VER'. The file has been downloaded, but will not be installed:\n${FILENAME}\n" 123 | 124 | exit 0 125 | 126 | fi 127 | 128 | if (( $+commands[pkginstall.sh] )) 129 | then 130 | 131 | pkginstall.sh "$FILENAME" 132 | 133 | else 134 | 135 | sudo /usr/sbin/installer -verbose -pkg "$FILENAME" -dumplog -target / -lang en 2>&1 | tee -a "$FILENAME:r.install.log" 136 | 137 | fi 138 | 139 | exit 0 140 | #EOF 141 | -------------------------------------------------------------------------------- /di-radiosilence.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install the latest version of Radio Silence 3 | # Warning! Requires 'sudo installer' so it cannot be run un-attended. 4 | # 5 | # From: Timothy J. Luoma 6 | # Mail: luomat at gmail dot com 7 | # Date: 2018-08-04 8 | # Verified: 2025-02-23 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | NAME="$0:t:r" 16 | 17 | INSTALL_TO='/Applications/Radio Silence.app' 18 | 19 | HOMEPAGE="http://radiosilenceapp.com" 20 | 21 | DOWNLOAD_PAGE="http://radiosilenceapp.com/download" 22 | 23 | SUMMARY="The easiest network monitor and firewall for Mac." 24 | 25 | URL=$(curl -sfL "https://radiosilenceapp.com/download" \ 26 | | awk -F'"' '/\/downloads\//{print "https://radiosilenceapp.com"$2}' \ 27 | | head -1) 28 | 29 | LATEST_VERSION=$(echo "$URL:t:r" | tr -dc '[0-9]\.') 30 | 31 | # If any of these are blank, we should not continue 32 | if [ "$URL" = "" -o "$LATEST_VERSION" = "" ] 33 | then 34 | echo "$NAME: Error: bad data received: 35 | LATEST_VERSION: $LATEST_VERSION 36 | URL: $URL 37 | " 38 | exit 1 39 | fi 40 | 41 | if [[ -e "$INSTALL_TO" ]] 42 | then 43 | 44 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 45 | 46 | autoload is-at-least 47 | 48 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 49 | 50 | VERSION_COMPARE="$?" 51 | 52 | if [ "$VERSION_COMPARE" = "0" ] 53 | then 54 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 55 | exit 0 56 | fi 57 | 58 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 59 | 60 | FIRST_INSTALL='no' 61 | 62 | else 63 | 64 | FIRST_INSTALL='yes' 65 | fi 66 | 67 | # No RELEASE_NOTES_URL available ☹️ 68 | 69 | FILENAME="$HOME/Downloads/$URL:t" 70 | 71 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 72 | 73 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 74 | 75 | EXIT="$?" 76 | 77 | ## exit 22 means 'the file was already fully downloaded' 78 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 79 | 80 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 81 | 82 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 83 | 84 | if (( $+commands[pkginstall.sh] )) 85 | then 86 | pkginstall.sh "$FILENAME" 87 | else 88 | sudo /usr/sbin/installer -verbose -pkg "$FILENAME" -dumplog -target / -lang en 89 | fi 90 | 91 | exit 0 92 | #EOF 93 | -------------------------------------------------------------------------------- /di-skype.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install the latest version of Skype 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2018-08-22 7 | # Verified: 2025-02-23 8 | 9 | NAME="$0:t:r" 10 | 11 | INSTALL_TO="/Applications/Skype.app" 12 | 13 | HOMEPAGE="https://www.skype.com/" 14 | 15 | DOWNLOAD_PAGE="https://get.skype.com/go/getskype-skypeformac" 16 | 17 | SUMMARY="Enjoy free voice and video calls on Skype or discover some of the many features to help you stay connected with the people you care about." 18 | 19 | if [[ -e "$HOME/.path" ]] 20 | then 21 | source "$HOME/.path" 22 | fi 23 | 24 | URL=$(curl -sfLS --head 'https://get.skype.com/go/getskype-skypeformac' \ 25 | | awk -F'\r| ' '/^.ocation/{print $2}') 26 | 27 | LATEST_VERSION=$(echo "$URL:t:r" | tr -dc '[0-9]\.') 28 | 29 | # If any of these are blank, we should not continue 30 | if [ "$URL" = "" -o "$LATEST_VERSION" = "" ] 31 | then 32 | echo "$NAME: Error: bad data received: 33 | LATEST_VERSION: $LATEST_VERSION 34 | URL: $URL 35 | " 36 | 37 | exit 1 38 | fi 39 | 40 | if [[ -e "$INSTALL_TO" ]] 41 | then 42 | 43 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleVersion) 44 | 45 | autoload is-at-least 46 | 47 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 48 | 49 | VERSION_COMPARE="$?" 50 | 51 | if [ "$VERSION_COMPARE" = "0" ] 52 | then 53 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION) $ASTERISK" 54 | exit 0 55 | fi 56 | 57 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 58 | 59 | FIRST_INSTALL='no' 60 | 61 | else 62 | 63 | FIRST_INSTALL='yes' 64 | fi 65 | 66 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.dmg" 67 | 68 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 69 | 70 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 71 | 72 | EXIT="$?" 73 | 74 | ## exit 22 means 'the file was already fully downloaded' 75 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 76 | 77 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 78 | 79 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 80 | 81 | echo "$NAME: Mounting $FILENAME:" 82 | 83 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 84 | | fgrep -A 1 'mount-point' \ 85 | | tail -1 \ 86 | | sed 's#.*##g ; s#.*##g') 87 | 88 | if [[ "$MNTPNT" == "" ]] 89 | then 90 | echo "$NAME: MNTPNT is empty" 91 | exit 1 92 | fi 93 | 94 | if [[ -e "$INSTALL_TO" ]] 95 | then 96 | # Quit app, if running 97 | pgrep -xq "$INSTALL_TO:t:r" \ 98 | && LAUNCH='yes' \ 99 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 100 | 101 | # move installed version to trash 102 | mv -f "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.${INSTALLED_VERSION}_${INSTALLED_BUILD}.app" 103 | fi 104 | 105 | echo "$NAME: Installing '$MNTPNT/$INSTALL_TO:t' to '$INSTALL_TO': " 106 | 107 | ditto --noqtn -v "$MNTPNT/$INSTALL_TO:t" "$INSTALL_TO" 108 | 109 | EXIT="$?" 110 | 111 | if [[ "$EXIT" == "0" ]] 112 | then 113 | echo "$NAME: Successfully installed $INSTALL_TO" 114 | else 115 | echo "$NAME: ditto failed" 116 | 117 | exit 1 118 | fi 119 | 120 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 121 | 122 | echo "$NAME: Unmounting $MNTPNT:" 123 | 124 | diskutil eject "$MNTPNT" 125 | 126 | exit 0 127 | #EOF 128 | -------------------------------------------------------------------------------- /di-smartgit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install/update the latest version of SmartGit from 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2018-08-26 7 | # Verified: 2025-03-03 8 | 9 | NAME="$0:t:r" 10 | 11 | INSTALL_TO="/Applications/SmartGit.app" 12 | 13 | RELEASE_NOTES_URL='https://www.syntevo.com/smartgit/changelog.txt' 14 | 15 | HOMEPAGE="https://www.syntevo.com/smartgit/" 16 | 17 | DOWNLOAD_PAGE="https://www.syntevo.com/smartgit/download/" 18 | 19 | SUMMARY="SmartGit is a graphical Git client with support for SVN and Pull Requests for GitHub and Bitbucket. SmartGit runs on Windows, macOS and Linux." 20 | 21 | if [[ -e "$HOME/.path" ]] 22 | then 23 | source "$HOME/.path" 24 | fi 25 | 26 | URL=$(curl -sfLS "https://www.syntevo.com/smartgit/download/" \ 27 | | egrep 'https://downloads.syntevo.com/downloads/smartgit/smartgit-aarch64-.*\.dmg' \ 28 | | tr '"' '\012' \ 29 | | egrep '^http.*\.dmg$') 30 | 31 | LATEST_VERSION=$(echo "$URL:t:r" | sed 's#smartgit-aarch64##g' | tr -dc '[0-9]_' | tr '_' '.') 32 | 33 | if [[ -e "$INSTALL_TO" ]] 34 | then 35 | 36 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 37 | 38 | autoload is-at-least 39 | 40 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 41 | 42 | VERSION_COMPARE="$?" 43 | 44 | if [ "$VERSION_COMPARE" = "0" ] 45 | then 46 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 47 | exit 0 48 | fi 49 | 50 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 51 | 52 | FIRST_INSTALL='no' 53 | 54 | else 55 | 56 | FIRST_INSTALL='yes' 57 | fi 58 | 59 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.dmg" 60 | 61 | ( curl -sfLS ${RELEASE_NOTES_URL} \ 62 | | awk '/SmartGit /{i++}i==1' ; \ 63 | echo "\nSource: <$RELEASE_NOTES_URL>" ) | tee "$FILENAME:r.txt" 64 | 65 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 66 | 67 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 68 | 69 | EXIT="$?" 70 | 71 | ## exit 22 means 'the file was already fully downloaded' 72 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 73 | 74 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 75 | 76 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 77 | 78 | echo "$NAME: Mounting $FILENAME:" 79 | 80 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 81 | | fgrep -A 1 'mount-point' \ 82 | | tail -1 \ 83 | | sed 's#.*##g ; s#.*##g') 84 | 85 | if [[ "$MNTPNT" == "" ]] 86 | then 87 | echo "$NAME: MNTPNT is empty" 88 | exit 1 89 | else 90 | echo "$NAME: MNTPNT is $MNTPNT" 91 | fi 92 | 93 | if [[ -e "$INSTALL_TO" ]] 94 | then 95 | # Quit app, if running 96 | pgrep -xq "$INSTALL_TO:t:r" \ 97 | && LAUNCH='yes' \ 98 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 99 | 100 | # move installed version to trash 101 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.${INSTALLED_VERSION}_${INSTALLED_BUILD}.app" 102 | fi 103 | 104 | echo "$NAME: Installing '$MNTPNT/$INSTALL_TO:t' to '$INSTALL_TO': " 105 | 106 | ditto --noqtn -v "$MNTPNT/$INSTALL_TO:t" "$INSTALL_TO" 107 | 108 | EXIT="$?" 109 | 110 | if [[ "$EXIT" == "0" ]] 111 | then 112 | echo "$NAME: Successfully installed $INSTALL_TO" 113 | else 114 | echo "$NAME: ditto failed" 115 | 116 | exit 1 117 | fi 118 | 119 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 120 | 121 | echo -n "$NAME: Unmounting $MNTPNT: " && diskutil eject "$MNTPNT" 122 | 123 | exit 0 124 | #EOF 125 | -------------------------------------------------------------------------------- /di-teams.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install the latest version of Microsoft Teams 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2025-03-07 7 | # Verified: 2025-03-07 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | [[ -e "$HOME/.config/di/defaults.sh" ]] && source "$HOME/.config/di/defaults.sh" 17 | 18 | INSTALL_TO="${INSTALL_DIR_ALTERNATE-/Applications}/Microsoft Teams.app" 19 | 20 | # Adapted from: 21 | # https://github.com/Homebrew/homebrew-cask/blob/master/Casks/m/microsoft-teams.rb 22 | # I just decided on putting the '7' there as a placeholder, and it works. 23 | # but obviously it could break in the future 24 | LINK="https://config.teams.microsoft.com/config/v1/MicrosoftTeams/7?environment=prod&audienceGroup=general&teamsRing=general&agent=TeamsBuilds" 25 | 26 | INFO=($(curl -sfLS "$LINK" \ 27 | | sed -e 's#.*"WebView2":{"macOS":{"latestVersion":"##g' \ 28 | -e 's#"}}.*##g' \ 29 | -e 's#","buildLink":"# #g')) 30 | 31 | LATEST_VERSION="$INFO[1]" 32 | 33 | URL="$INFO[2]" 34 | 35 | # If any of these are blank, we cannot continue 36 | if [ "$INFO" = "" -o "$URL" = "" -o "$LATEST_VERSION" = "" ] 37 | then 38 | echo "$NAME: Error: bad data received: 39 | INFO: $INFO 40 | LATEST_VERSION: $LATEST_VERSION 41 | URL: $URL 42 | " >>/dev/stderr 43 | 44 | exit 1 45 | fi 46 | 47 | if [[ -e "$INSTALL_TO" ]] 48 | then 49 | 50 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 51 | 52 | autoload is-at-least 53 | 54 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 55 | 56 | VERSION_COMPARE="$?" 57 | 58 | if [ "$VERSION_COMPARE" = "0" ] 59 | then 60 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 61 | exit 0 62 | fi 63 | 64 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 65 | 66 | FIRST_INSTALL='no' 67 | 68 | else 69 | 70 | FIRST_INSTALL='yes' 71 | fi 72 | 73 | FILENAME="${DOWNLOAD_DIR_ALTERNATE-$HOME/Downloads}/${${INSTALL_TO:t:r}// /}-${${LATEST_VERSION}// /}.pkg" 74 | 75 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 76 | 77 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 78 | 79 | EXIT="$?" 80 | 81 | ## exit 22 means 'the file was already fully downloaded' 82 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 83 | 84 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 85 | 86 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 87 | 88 | egrep -q '^Local sha256:$' "$FILENAME:r.txt" 2>/dev/null 89 | 90 | EXIT="$?" 91 | 92 | if [ "$EXIT" = "1" -o ! -e "$FILENAME:r.txt" ] 93 | then 94 | (cd "$FILENAME:h" ; \ 95 | echo "\n\nLocal sha256:" ; \ 96 | shasum -a 256 "$FILENAME:t" \ 97 | ) >>| "$FILENAME:r.txt" 98 | fi 99 | 100 | if (( $+commands[pkginstall.sh] )) 101 | then 102 | # use 'pkginstall.sh' if it exists 103 | 104 | pkginstall.sh "$FILENAME" 105 | 106 | else 107 | # fall back to either `sudo installer` or macOS's installer app 108 | sudo /usr/sbin/installer -verbose -pkg "$FILENAME" -dumplog -target / -lang en 2>&1 \ 109 | || open -b com.apple.installer "$FILENAME" 110 | 111 | fi 112 | 113 | exit 0 114 | # 115 | #EOF -------------------------------------------------------------------------------- /di-there.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Keeps track of people or place's timezones (https://there.pm or https://there.team) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-07 7 | 8 | NAME="$0:t:r" 9 | 10 | echo "$NAME: New repo home at https://github.com/dena-sohrabi/There" 11 | 12 | exit 1 13 | 14 | # https://github.com/dena-sohrabi/There/releases/latest 15 | # https://github.com/dena-sohrabi/There/releases/download/v2.0.0/There.zip 16 | 17 | if [[ -e "$HOME/.path" ]] 18 | then 19 | source "$HOME/.path" 20 | fi 21 | 22 | INSTALL_TO='/Applications/There.app' 23 | 24 | LATEST_VERSION=$(curl -sfLS 'https://github.com/therehq/there-desktop/releases.atom' \ 25 | | fgrep -i 'https://github.com/therehq/there-desktop/releases/tag/' \ 26 | | head -1 \ 27 | | sed 's#.*/tag/v##g; s#"/>##g') 28 | 29 | ## This seems to work too: https://apiv1.there.team/download/macos 30 | ## but the github format seems to be 31 | ## https://github.com/therehq/there-desktop/releases/download/v1.7.9/There-1.7.9-mac.zip 32 | 33 | URL="https://github.com/therehq/there-desktop/releases/download/v${LATEST_VERSION}/There-${LATEST_VERSION}-mac.zip" 34 | 35 | if [[ -e "$INSTALL_TO" ]] 36 | then 37 | 38 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 39 | 40 | autoload is-at-least 41 | 42 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 43 | 44 | VERSION_COMPARE="$?" 45 | 46 | if [ "$VERSION_COMPARE" = "0" ] 47 | then 48 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 49 | exit 0 50 | fi 51 | 52 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 53 | 54 | FIRST_INSTALL='no' 55 | 56 | else 57 | 58 | FIRST_INSTALL='yes' 59 | fi 60 | 61 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 62 | 63 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 64 | 65 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 66 | 67 | EXIT="$?" 68 | 69 | ## exit 22 means 'the file was already fully downloaded' 70 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 71 | 72 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 73 | 74 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 75 | 76 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 77 | 78 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 79 | 80 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 81 | 82 | EXIT="$?" 83 | 84 | if [[ "$EXIT" == "0" ]] 85 | then 86 | echo "$NAME: Unzip successful" 87 | else 88 | # failed 89 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 90 | 91 | exit 1 92 | fi 93 | 94 | if [[ -e "$INSTALL_TO" ]] 95 | then 96 | 97 | pgrep -xq "$INSTALL_TO:t:r" \ 98 | && LAUNCH='yes' \ 99 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 100 | 101 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 102 | 103 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 104 | 105 | EXIT="$?" 106 | 107 | if [[ "$EXIT" != "0" ]] 108 | then 109 | 110 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 111 | 112 | exit 1 113 | fi 114 | fi 115 | 116 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 117 | 118 | # Move the file out of the folder 119 | mv -vn "$UNZIP_TO/$INSTALL_TO:t" "$INSTALL_TO" 120 | 121 | EXIT="$?" 122 | 123 | if [[ "$EXIT" = "0" ]] 124 | then 125 | 126 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 127 | 128 | else 129 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 130 | 131 | exit 1 132 | fi 133 | 134 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 135 | 136 | exit 0 137 | #EOF 138 | -------------------------------------------------------------------------------- /di-unpkg.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install the latest version of unpkg 3 | # Source: https://www.timdoug.com/unpkg/ 4 | # 5 | # From: Timothy J. Luoma 6 | # Mail: luomat at gmail dot com 7 | # Date: 2018-07-20 8 | # Verified: 2025-02-22 [but I don't like it. No real XML_FEED.] 9 | 10 | NAME="$0:t:r" 11 | 12 | INSTALL_TO='/Applications/unpkg.app' 13 | 14 | HOMEPAGE="https://www.timdoug.com/unpkg/" 15 | 16 | DOWNLOAD_PAGE="https://github.com/timdoug/unpkg/releases" 17 | 18 | SUMMARY="a Mac OS X .[m]pkg unarchiver" 19 | 20 | if [[ -e "$HOME/.path" ]] 21 | then 22 | source "$HOME/.path" 23 | fi 24 | 25 | CASK_FILE="/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/unpkg.rb" 26 | 27 | # The app apparently hasn't been updated since 2010-08-26 so it's pretty safe to hard-code the LATEST_VERSION 28 | 29 | if [[ -e "$CASK_FILE" ]] 30 | then 31 | # get the latest 32 | LATEST_VERSION=$(awk -F"'" '/version /{print $2}' "$CASK_FILE" 2>/dev/null) 33 | 34 | # If we didn't find anything in the $CASK_FILE, then use '4.5 as a known version 35 | [[ "$LATEST_VERSION" == "" ]] && LATEST_VERSION="4.5" 36 | else 37 | LATEST_VERSION="4.8" 38 | fi 39 | 40 | URL="https://www.timdoug.com/unpkg/unpkg-${LATEST_VERSION}.zip" 41 | 42 | if [[ -e "$INSTALL_TO" ]] 43 | then 44 | 45 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 46 | 47 | autoload is-at-least 48 | 49 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 50 | 51 | VERSION_COMPARE="$?" 52 | 53 | if [ "$VERSION_COMPARE" = "0" ] 54 | then 55 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 56 | exit 0 57 | fi 58 | 59 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 60 | 61 | FIRST_INSTALL='no' 62 | 63 | else 64 | 65 | FIRST_INSTALL='yes' 66 | fi 67 | 68 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.zip" 69 | 70 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 71 | 72 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 73 | 74 | EXIT="$?" 75 | 76 | ## exit 22 means 'the file was already fully downloaded' 77 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 78 | 79 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 80 | 81 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 82 | 83 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 84 | 85 | echo "$NAME: Unzipping $FILENAME to $UNZIP_TO:" 86 | 87 | ditto --noqtn -xk "$FILENAME" "$UNZIP_TO" 88 | 89 | EXIT="$?" 90 | 91 | if [[ "$EXIT" == "0" ]] 92 | then 93 | echo "$NAME: Unzip successful" 94 | else 95 | # failed 96 | echo "$NAME failed (ditto --noqtn -xkv '$FILENAME' '$UNZIP_TO')" 97 | 98 | exit 1 99 | fi 100 | 101 | if [[ -e "$INSTALL_TO" ]] 102 | then 103 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 104 | 105 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 106 | 107 | EXIT="$?" 108 | 109 | if [[ "$EXIT" != "0" ]] 110 | then 111 | 112 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 113 | 114 | exit 1 115 | fi 116 | fi 117 | 118 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 119 | 120 | # Move the file out of the folder 121 | ## Note there is an extra sub-folder compared to what we usually find in "$UNZIP_TO/" 122 | mv -vn "$UNZIP_TO/$INSTALL_TO:t:r ${LATEST_VERSION}/$INSTALL_TO:t" "$INSTALL_TO" 123 | 124 | EXIT="$?" 125 | 126 | if [[ "$EXIT" = "0" ]] 127 | then 128 | 129 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 130 | 131 | else 132 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 133 | 134 | exit 1 135 | fi 136 | 137 | exit 0 138 | # 139 | #EOF 140 | -------------------------------------------------------------------------------- /di-zoom.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install/update the latest version of Zoom 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2022-03-24 7 | # Verified: 2025-02-15 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | INSTALL_TO='/Applications/zoom.us.app' 17 | 18 | RELEASE_NOTES_URL='https://support.zoom.us/hc/en-us/articles/201361963-Release-notes-for-macOS' 19 | 20 | ARCH=$(sysctl kern.version | awk -F'_' '/RELEASE/{print $2}') 21 | 22 | if [[ "$ARCH" == "ARM64" ]] 23 | then 24 | 25 | PKG_URL='https://zoom.us/client/latest/Zoom.pkg?archType=arm64' 26 | 27 | elif [[ "$ARCH" == "X86" ]] 28 | then 29 | 30 | PKG_URL='https://zoom.us/client/latest/Zoom.pkg' 31 | 32 | else 33 | 34 | echo "$NAME: 'sysctl kern.version' returned unknown arch: '$ARCH'" >>/dev/stderr 35 | exit 2 36 | 37 | fi 38 | 39 | URL=$(curl -sfLS --head "$PKG_URL" | awk -F' |\r' '/^.ocation:/{print $2}' | tail -1) 40 | 41 | LATEST_VERSION=$(echo "${URL}" | awk -F'/' '/http/{print $5}') 42 | 43 | # If any of these are blank, we cannot continue 44 | if [ "$URL" = "" -o "$LATEST_VERSION" = "" ] 45 | then 46 | echo "$NAME: Error: bad data received: 47 | LATEST_VERSION: $LATEST_VERSION 48 | URL: $URL 49 | " 50 | 51 | exit 1 52 | fi 53 | 54 | 55 | echo " 56 | $URL 57 | $LATEST_VERSION 58 | " 59 | 60 | 61 | if [[ -e "$INSTALL_TO" ]] 62 | then 63 | 64 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleVersion) 65 | 66 | autoload is-at-least 67 | 68 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 69 | 70 | VERSION_COMPARE="$?" 71 | 72 | if [ "$VERSION_COMPARE" = "0" ] 73 | then 74 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 75 | exit 0 76 | fi 77 | 78 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 79 | 80 | FIRST_INSTALL='no' 81 | 82 | else 83 | 84 | FIRST_INSTALL='yes' 85 | fi 86 | 87 | FILENAME="${DOWNLOAD_DIR_ALTERNATE-$HOME/Downloads}/Zoom-${LATEST_VERSION}.$ARCH:l.pkg" 88 | 89 | if (( $+commands[lynx] )) 90 | then 91 | 92 | (curl -A Safari -sfLS "$RELEASE_NOTES_URL" \ 93 | | sed '1,/

Current Release<\/h2>/d; /

Previous Releases<\/h2>/,$d' \ 94 | | fgrep -v '
' \ 95 | | lynx -dump -nomargins -width='1000' -assume_charset=UTF-8 -pseudo_inlines -stdin ; 96 | echo "\nSource: $RELEASE_NOTES_URL\nURL: $URL" ) \ 97 | | tee "$FILENAME:r.txt" 98 | 99 | fi 100 | 101 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 102 | 103 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 104 | 105 | EXIT="$?" 106 | 107 | ## exit 22 means 'the file was already fully downloaded' 108 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 109 | 110 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 111 | 112 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 113 | 114 | (cd "$FILENAME:h" ; echo "\n\nLocal sha256:" ; shasum -a 256 "$FILENAME:t" ) >>| "$FILENAME:r.txt" 115 | 116 | ######## 117 | 118 | echo "$NAME: Preparing to install $FILENAME" 119 | 120 | if (( $+commands[pkginstall.sh] )) 121 | then 122 | 123 | pkginstall.sh "$FILENAME" 124 | 125 | else 126 | 127 | if [ "$EUID" = "0" ] 128 | then 129 | 130 | /usr/sbin/installer -pkg "$FILENAME" -target / -lang en 131 | 132 | else 133 | # Try sudo but if it fails, open pkg in Finder 134 | sudo /usr/sbin/installer -pkg "$FILENAME" -dumplog -target / -lang en \ 135 | || open -R "$FILENAME" 136 | 137 | fi 138 | fi 139 | 140 | 141 | 142 | exit 0 143 | #EOF 144 | -------------------------------------------------------------------------------- /discontinued/di-1password6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install the latest version of 1Password 6 (note that 1Password 7 is also available) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2016-01-19 7 | 8 | NAME="$0:t:r" 9 | 10 | if [ -e "$HOME/.path" ] 11 | then 12 | source "$HOME/.path" 13 | else 14 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 15 | fi 16 | 17 | INSTALL_TO='/Applications/1Password 6.app' 18 | 19 | # https://app-updates.agilebits.com/download/OPM4 20 | # currently redirects to: 21 | # https://c.1password.com/dist/1P/mac4/1Password-6.8.9.pkg 22 | 23 | URL=$(curl -sfL --head 'https://app-updates.agilebits.com/download/OPM4' | awk -F' |\r' '/^.ocation/{print $2}' | tail -1) 24 | 25 | LATEST_VERSION=$(echo "$URL:t:r" | sed 's#1Password-##g' | tr -dc '[0-9]\.') 26 | 27 | # If any of these are blank, we should not continue 28 | if [ "$LATEST_VERSION" = "" -o "$URL" = "" ] 29 | then 30 | echo "$NAME: Error: bad data received: 31 | LATEST_VERSION: $LATEST_VERSION 32 | URL: $URL 33 | " 34 | 35 | exit 1 36 | fi 37 | 38 | if [[ -e "$INSTALL_TO" ]] 39 | then 40 | 41 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 42 | 43 | autoload is-at-least 44 | 45 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 46 | 47 | VERSION_COMPARE="$?" 48 | 49 | if [ "$VERSION_COMPARE" = "0" ] 50 | then 51 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 52 | exit 0 53 | fi 54 | 55 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 56 | 57 | FIRST_INSTALL='no' 58 | 59 | else 60 | 61 | FIRST_INSTALL='yes' 62 | fi 63 | 64 | FILENAME="$HOME/Downloads/1Password-${LATEST_VERSION}.pkg" 65 | 66 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 67 | 68 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 69 | 70 | EXIT="$?" 71 | 72 | ## exit 22 means 'the file was already fully downloaded' 73 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 74 | 75 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 76 | 77 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 78 | 79 | function die 80 | { 81 | echo "$NAME: $@" 82 | exit 1 83 | } 84 | 85 | if (( $+commands[unpkg.py] )) 86 | then 87 | # Get unpkg.py from https://github.com/tjluoma/unpkg/blob/master/unpkg.py 88 | 89 | echo "$NAME: running 'unpkg.py' on '$FILENAME':" 90 | 91 | UNPKG=`unpkg.py "$FILENAME" 2>&1` 92 | 93 | [[ "$UNPKG" == "" ]] && die "unpkg.py failed" 94 | 95 | EXTRACTED_TO=$(echo "$UNPKG" | egrep '^Extracted to ' | sed 's#Extracted to "##g ; s#".##g') 96 | 97 | [[ "$EXTRACTED_TO" == "" ]] && die "unpkg.py failed (EXTRACTED_TO empty)" 98 | 99 | if [[ -e "$INSTALL_TO" ]] 100 | then 101 | # If there's an existing installation, move it to the trash 102 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.${INSTALLED_VERSION}.app" 103 | fi 104 | 105 | mv -vf "$EXTRACTED_TO/$INSTALL_TO:t" "$INSTALL_TO" || die 'move failed' 106 | 107 | elif (( $+commands[pkginstall.sh] )) 108 | then 109 | 110 | pkginstall.sh "$FILENAME" || die "pkginstall.sh failed" 111 | 112 | else 113 | 114 | sudo /usr/sbin/installer -verbose -pkg "$FILENAME" -dumplog -target / -lang en 2>&1 || die "sudo installer failed" 115 | fi 116 | 117 | exit 0 118 | #EOF 119 | -------------------------------------------------------------------------------- /discontinued/di-32bitcheck.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 32-bitCheck https://eclecticlight.co 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-16 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/32-bitCheck.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' 32-bitCheck$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' 32-bitCheck$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /discontinued/di-alfred2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install Alfred 2, or update it if already installed (note there is a separate script for Alfred 3) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-11-10 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO='/Applications/Alfred 2.app' 11 | 12 | if [ -e "$HOME/.path" ] 13 | then 14 | source "$HOME/.path" 15 | else 16 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 17 | fi 18 | 19 | LAUNCH='no' 20 | 21 | XML_FEED='https://cachefly.alfredapp.com/updater/info.plist' 22 | 23 | INFO=($(curl -sfL "$XML_FEED" \ 24 | | egrep -A1 'version|build|location' \ 25 | | egrep '|' \ 26 | | head -3 \ 27 | | awk -F'>|<' '//{print $3}')) 28 | 29 | MAJOR_VERSION="$INFO[1]" 30 | LATEST_VERSION="$INFO[2]" 31 | URL="$INFO[3]" 32 | 33 | # If any of these are blank, we should not continue 34 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" -o "$MAJOR_VERSION" = "" ] 35 | then 36 | echo "$NAME: Error: bad data received: 37 | INFO: $INFO 38 | LATEST_VERSION: $LATEST_VERSION 39 | MAJOR_VERSION: $MAJOR_VERSION 40 | URL: $URL 41 | " 42 | 43 | exit 1 44 | fi 45 | 46 | FILENAME="$HOME/Downloads/Alfred-${MAJOR_VERSION}-${LATEST_VERSION}.zip" 47 | 48 | if [[ -e "$INSTALL_TO" ]] 49 | then 50 | 51 | # Note that we are using the Build Number/CFBundleVersion for Alfred, 52 | # because that changes more often than the CFBundleShortVersionString 53 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleVersion 2>/dev/null || echo '0'` 54 | 55 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 56 | then 57 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 58 | exit 0 59 | fi 60 | 61 | autoload is-at-least 62 | 63 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 64 | 65 | if [ "$?" = "0" ] 66 | then 67 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 68 | exit 0 69 | fi 70 | 71 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 72 | 73 | fi 74 | 75 | echo "$NAME: Downloading $URL to $FILENAME" 76 | 77 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 78 | 79 | EXIT="$?" 80 | 81 | ## exit 22 means 'the file was already fully downloaded' 82 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 83 | 84 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 85 | 86 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 87 | 88 | if [ -e "$INSTALL_TO" ] 89 | then 90 | # Quit app, if running 91 | pgrep -xq "Alfred 2" \ 92 | && LAUNCH='yes' \ 93 | && osascript -e 'tell application "Alfred 2" to quit' 94 | 95 | # move installed version to trash 96 | mv -vf "$INSTALL_TO" "$HOME/.Trash/Alfred 2.$INSTALLED_VERSION.app" 97 | fi 98 | 99 | echo "$NAME: Installing $FILENAME to $INSTALL_TO:h/" 100 | 101 | ditto --noqtn -xk "$FILENAME" "$INSTALL_TO:h/" 102 | 103 | EXIT="$?" 104 | 105 | if [ "$EXIT" = "0" ] 106 | then 107 | 108 | echo "$NAME: Installation of $INSTALL_TO successful" 109 | 110 | else 111 | echo "$NAME: 'ditto' failed (\$EXIT = $EXIT)" 112 | 113 | exit 1 114 | fi 115 | 116 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 117 | 118 | exit 0 119 | #EOF 120 | -------------------------------------------------------------------------------- /discontinued/di-appfixer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install the latest version of App Fixer 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-11-24 7 | 8 | NAME="$0:t:r" 9 | 10 | echo "$NAME: https://sqwarq.com/appfixer/ says 'App Fixer has been discontinued.'" 11 | 12 | exit 0 13 | 14 | 15 | 16 | 17 | ### The code below is left as reference, but no longer works. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | if [ -e "$HOME/.path" ] 31 | then 32 | source "$HOME/.path" 33 | else 34 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 35 | fi 36 | 37 | LATEST_VERSION=`curl -sfL https://s3.amazonaws.com/sqwarq.com/AppFixerDownload/updateappfixer.html` 38 | 39 | INSTALL_TO='/Applications/App Fixer.app' 40 | 41 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo 0` 42 | 43 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 44 | then 45 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 46 | exit 0 47 | fi 48 | 49 | autoload is-at-least 50 | 51 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 52 | 53 | if [ "$?" = "0" ] 54 | then 55 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 56 | exit 0 57 | fi 58 | 59 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 60 | 61 | # URL='https://s3.amazonaws.com/sqwarq.com/AppFixerDownload/App+Fixer.app.zip' 62 | 63 | URL='https://s3.amazonaws.com/sqwarq.com/PublicZips/AppFixer.app.zip' 64 | 65 | FILENAME="$HOME/Downloads/AppFixer-$LATEST_VERSION.zip" 66 | 67 | echo "$NAME: Downloading $URL to $FILENAME" 68 | 69 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 70 | 71 | EXIT="$?" 72 | 73 | ## exit 22 means 'the file was already fully downloaded' 74 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download failed (EXIT = $EXIT)" && exit 0 75 | 76 | if [ -e "$INSTALL_TO" ] 77 | then 78 | # Quit app, if running 79 | pgrep -xq "App Fixer" \ 80 | && LAUNCH='yes' \ 81 | && osascript -e 'tell application "App Fixer" to quit' 82 | 83 | # move installed version to trash 84 | mv -vf "$INSTALL_TO" "$HOME/.Trash/App Fixer.$INSTALLED_VERSION.app" 85 | fi 86 | 87 | echo "$NAME: Installing $FILENAME to $INSTALL_TO:h/" 88 | 89 | # Extract from the .zip file and install (this will leave the .zip file in place) 90 | ditto --noqtn -xk "$FILENAME" "$INSTALL_TO:h/" 91 | 92 | EXIT="$?" 93 | 94 | if [ "$EXIT" = "0" ] 95 | then 96 | echo "$NAME: Installation of $INSTALL_TO was successful." 97 | 98 | [[ "$LAUNCH" == "yes" ]] && open -a "$INSTALL_TO" 99 | 100 | else 101 | echo "$NAME: Installation of $INSTALL_TO failed (\$EXIT = $EXIT)\nThe downloaded file can be found at $FILENAME." 102 | fi 103 | 104 | 105 | exit 0 106 | #EOF 107 | -------------------------------------------------------------------------------- /discontinued/di-authy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install/update the latest version of Authy Desktop from 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-09-13 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | DOWNLOAD='https://authy.com/download/' 16 | 17 | URL=$(curl --dump-header - -sfS 'https://electron.authy.com/download?channel=stable&arch=x64&platform=darwin&version=latest&product=authy' \ 18 | | egrep -i '^Location: ' \ 19 | | tr -d '\r' \ 20 | | sed 's#^.ocation: ##g ; s# #%20#g') 21 | 22 | [[ "$URL" == "" ]] && echo "$NAME: URL is empty." && exit 1 23 | 24 | LATEST_VERSION=$(echo "$URL:t:r" | sed 's#Authy%20Desktop-##g') 25 | 26 | INSTALL_TO='/Applications/Authy Desktop.app' 27 | 28 | if [[ -e "$INSTALL_TO" ]] 29 | then 30 | 31 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 32 | 33 | autoload is-at-least 34 | 35 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 36 | 37 | VERSION_COMPARE="$?" 38 | 39 | if [ "$VERSION_COMPARE" = "0" ] 40 | then 41 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 42 | exit 0 43 | fi 44 | 45 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 46 | 47 | FIRST_INSTALL='no' 48 | 49 | else 50 | 51 | FIRST_INSTALL='yes' 52 | fi 53 | 54 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.dmg" 55 | 56 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 57 | 58 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 59 | 60 | EXIT="$?" 61 | 62 | ## exit 22 means 'the file was already fully downloaded' 63 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 64 | 65 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 66 | 67 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 68 | 69 | (cd "$FILENAME:h" ; echo "\nURL: ${URL}\nLocal sha256:" ; shasum -a 256 "$FILENAME:t" ) >>| "$FILENAME:r.txt" 70 | 71 | echo "$NAME: Mounting $FILENAME:" 72 | 73 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 74 | | fgrep -A 1 'mount-point' \ 75 | | tail -1 \ 76 | | sed 's#.*##g ; s#.*##g') 77 | 78 | if [[ "$MNTPNT" == "" ]] 79 | then 80 | echo "$NAME: MNTPNT is empty" 81 | exit 1 82 | else 83 | echo "$NAME: MNTPNT is $MNTPNT" 84 | fi 85 | 86 | if [[ -e "$INSTALL_TO" ]] 87 | then 88 | # Quit app, if running 89 | pgrep -xq "$INSTALL_TO:t:r" \ 90 | && LAUNCH='yes' \ 91 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 92 | 93 | # move installed version to trash 94 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.${INSTALLED_VERSION}_${INSTALLED_BUILD}.app" 95 | 96 | EXIT="$?" 97 | 98 | if [[ "$EXIT" != "0" ]] 99 | then 100 | 101 | echo "$NAME: failed to move '$INSTALL_TO' to Trash. ('mv' \$EXIT = $EXIT)" 102 | 103 | exit 1 104 | fi 105 | 106 | fi 107 | 108 | echo "$NAME: Installing '$MNTPNT/$INSTALL_TO:t' to '$INSTALL_TO': " 109 | 110 | ditto --noqtn -v "$MNTPNT/$INSTALL_TO:t" "$INSTALL_TO" 111 | 112 | EXIT="$?" 113 | 114 | if [[ "$EXIT" == "0" ]] 115 | then 116 | echo "$NAME: Successfully installed $INSTALL_TO" 117 | else 118 | echo "$NAME: ditto failed" 119 | 120 | exit 1 121 | fi 122 | 123 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 124 | 125 | echo -n "$NAME: Unmounting $MNTPNT: " && diskutil eject "$MNTPNT" 126 | 127 | exit 0 128 | #EOF 129 | -------------------------------------------------------------------------------- /discontinued/di-batteryalert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install the latest version of Battery Alert 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-11-24 7 | 8 | NAME="$0:t:r" 9 | 10 | echo "$NAME: https://sqwarq.com/batteryalert/ is now 404 and the app no longer seems to be available." 11 | 12 | exit 0 13 | 14 | 15 | ### The code below is left for reference / historical purposes, but no longer works as of at least 2018-08-02 16 | 17 | 18 | 19 | 20 | 21 | if [ -e "$HOME/.path" ] 22 | then 23 | source "$HOME/.path" 24 | else 25 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 26 | fi 27 | 28 | LATEST_VERSION=`curl -sfL https://s3.amazonaws.com/sqwarq.com/AppCasts/updateBatteryAlert.html` 29 | 30 | INSTALL_TO='/Applications/BatteryAlert.app' 31 | 32 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo 0` 33 | 34 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 35 | then 36 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 37 | exit 0 38 | fi 39 | 40 | autoload is-at-least 41 | 42 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 43 | 44 | if [ "$?" = "0" ] 45 | then 46 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 47 | exit 0 48 | fi 49 | 50 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 51 | 52 | URL='https://s3.amazonaws.com/sqwarq.com/PublicZips/BatteryAlert.app.zip' 53 | 54 | FILENAME="$HOME/Downloads/BatteryAlert-$LATEST_VERSION.zip" 55 | 56 | echo "$NAME: Downloading $URL to $FILENAME" 57 | 58 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 59 | 60 | EXIT="$?" 61 | 62 | ## exit 22 means 'the file was already fully downloaded' 63 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download failed (EXIT = $EXIT)" && exit 0 64 | 65 | if [ -e "$INSTALL_TO" ] 66 | then 67 | # Quit app, if running 68 | pgrep -xq "BatteryAlert" \ 69 | && LAUNCH='yes' \ 70 | && osascript -e 'tell application "BatteryAlert" to quit' 71 | 72 | # move installed version to trash 73 | mv -vf "$INSTALL_TO" "$HOME/.Trash/BatteryAlert.$INSTALLED_VERSION.app" 74 | fi 75 | 76 | echo "$NAME: Installing $FILENAME to $INSTALL_TO:h/" 77 | 78 | # Extract from the .zip file and install (this will leave the .zip file in place) 79 | ditto --noqtn -xk "$FILENAME" "$INSTALL_TO:h/" 80 | 81 | EXIT="$?" 82 | 83 | if [ "$EXIT" = "0" ] 84 | then 85 | echo "$NAME: Installation of $INSTALL_TO was successful." 86 | 87 | [[ "$LAUNCH" == "yes" ]] && open -a "$INSTALL_TO" 88 | 89 | else 90 | echo "$NAME: Installation of $INSTALL_TO failed (\$EXIT = $EXIT)\nThe downloaded file can be found at $FILENAME." 91 | fi 92 | 93 | 94 | exit 0 95 | #EOF 96 | -------------------------------------------------------------------------------- /discontinued/di-carboncopycloner4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install Carbon Copy Cloner, version 4 (note that version 5 is out) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2016-05-02 7 | 8 | NAME="$0:t:r" 9 | 10 | if [ -e "$HOME/.path" ] 11 | then 12 | source "$HOME/.path" 13 | else 14 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 15 | fi 16 | 17 | INSTALL_TO='/Applications/Carbon Copy Cloner 4.app' 18 | 19 | URL=$(curl -sfL --head 'https://bombich.com/software/download_ccc.php?v=4.1.23.4644' | awk -F' |\r' '/^.ocation/{print $2}') 20 | 21 | LATEST_VERSION="4.1.23" 22 | 23 | # If either of these are blank, we should not continue 24 | if [ "$URL" = "" -o "$LATEST_VERSION" = "" ] 25 | then 26 | echo "$NAME: Error: bad data received: 27 | LATEST_VERSION: $LATEST_VERSION 28 | URL: $URL 29 | " 30 | 31 | exit 1 32 | fi 33 | 34 | if [[ -e "$INSTALL_TO" ]] 35 | then 36 | 37 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 38 | 39 | autoload is-at-least 40 | 41 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 42 | 43 | VERSION_COMPARE="$?" 44 | 45 | if [ "$VERSION_COMPARE" = "0" ] 46 | then 47 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 48 | exit 0 49 | fi 50 | 51 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 52 | 53 | fi 54 | 55 | FILENAME="$HOME/Downloads/CarbonCopyCloner-${LATEST_VERSION}.zip" 56 | 57 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 58 | 59 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 60 | 61 | EXIT="$?" 62 | 63 | ## exit 22 means 'the file was already fully downloaded' 64 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 65 | 66 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 67 | 68 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 69 | 70 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 71 | 72 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 73 | 74 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 75 | 76 | EXIT="$?" 77 | 78 | if [[ "$EXIT" == "0" ]] 79 | then 80 | echo "$NAME: Unzip successful" 81 | else 82 | # failed 83 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 84 | 85 | exit 1 86 | fi 87 | 88 | if [[ -e "$INSTALL_TO" ]] 89 | then 90 | echo "$NAME: Moving existing (old) \"$INSTALL_TO\" to \"$HOME/.Trash/\"." 91 | 92 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 93 | 94 | EXIT="$?" 95 | 96 | if [[ "$EXIT" != "0" ]] 97 | then 98 | 99 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 100 | 101 | exit 1 102 | fi 103 | fi 104 | 105 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 106 | 107 | # Move the file out of the folder 108 | # Note that we are renaming 'Carbon Copy Cloner.app' to 'Carbon Copy Cloner 4.app' as we do this 109 | mv -vn "$UNZIP_TO/Carbon Copy Cloner.app" "$INSTALL_TO" 110 | 111 | EXIT="$?" 112 | 113 | if [[ "$EXIT" = "0" ]] 114 | then 115 | 116 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 117 | 118 | else 119 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 120 | 121 | exit 1 122 | fi 123 | 124 | exit 0 125 | #EOF 126 | -------------------------------------------------------------------------------- /discontinued/di-charles3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install the latest (last?) version of Charles Proxy v3 (v4 is now available) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2018-08-04 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO='/Applications/Charles 3.app' 11 | 12 | if [[ -e "$HOME/.path" ]] 13 | then 14 | source "$HOME/.path" 15 | else 16 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 17 | fi 18 | 19 | URL="https://www.charlesproxy.com/assets/release/3.12.3/charles-proxy-3.12.3.dmg" 20 | 21 | LATEST_VERSION=`echo "$URL:t:r" | tr -dc '[0-9]\.'` 22 | 23 | FILENAME="$HOME/Downloads/Charles-${LATEST_VERSION}.dmg" 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | echo "$NAME: Downloading $URL to $FILENAME" 52 | 53 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 54 | 55 | EXIT="$?" 56 | 57 | ## exit 22 means 'the file was already fully downloaded' 58 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 59 | 60 | if [ -e "$INSTALL_TO" ] 61 | then 62 | # Quit app, if running 63 | pgrep -xq "Charles" \ 64 | && LAUNCH='yes' \ 65 | && osascript -e 'tell application "Charles" to quit' 66 | 67 | # move installed version to trash 68 | mv -vf "$INSTALL_TO" "$HOME/.Trash/Charles.$INSTALLED_VERSION.app" 69 | fi 70 | 71 | # Note that this will automatically accept the EULA without reading it 72 | # just like you would have done :-) 73 | MNTPNT=$(echo -n "Y" | hdid -plist "$FILENAME" 2>/dev/null | fgrep '/Volumes/' | sed 's###g ; s#.*##g') 74 | 75 | if [[ "$MNTPNT" == "" ]] 76 | then 77 | echo "$NAME: MNTPNT is empty" 78 | exit 1 79 | fi 80 | 81 | echo "$NAME: Installing $FILENAME to $INSTALL_TO:h/" 82 | 83 | # Extract from the .zip file and install (this will leave the .zip file in place) 84 | ditto --noqtn -v "$MNTPNT/Charles.app" "$INSTALL_TO" 85 | 86 | EXIT="$?" 87 | 88 | if [ "$EXIT" = "0" ] 89 | then 90 | echo "$NAME: Installation of $INSTALL_TO was successful." 91 | 92 | [[ "$LAUNCH" == "yes" ]] && open -a "$INSTALL_TO" 93 | 94 | else 95 | echo "$NAME: Installation of $INSTALL_TO failed (\$EXIT = $EXIT)\nThe downloaded file can be found at $FILENAME." 96 | 97 | exit 1 98 | fi 99 | 100 | diskutil eject "$MNTPNT" 101 | 102 | exit 0 103 | #EOF 104 | -------------------------------------------------------------------------------- /discontinued/di-clarify.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install latest version of http://www.clarify-it.com/ 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-12-04 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO='/Applications/Clarify.app' 11 | 12 | HOMEPAGE="http://www.clarify-it.com/" 13 | 14 | DOWNLOAD_PAGE="http://www.clarify-it.com/download/mac" 15 | 16 | SUMMARY="Clarify 2 _was_ a Faster, Simpler Alternative to Screen Recording." 17 | 18 | if [[ -e "$HOME/.path" ]] 19 | then 20 | source "$HOME/.path" 21 | fi 22 | 23 | ## 2018-07-17 this feed seemed to be outdated 24 | #XML_FEED='http://www.bluemangolearning.com/download/clarify/2_0/auto_update/release/clarify_appcast.xml' 25 | ## 26 | ## 2018-07-17 found new feed via find_appcast 27 | XML_FEED="https://s3.amazonaws.com/files.clarify-it.com/v2/updaters/release/appcast.xml" 28 | 29 | INFO=($(curl -sfL "$XML_FEED" \ 30 | | tr -s ' ' '\012' \ 31 | | egrep 'sparkle:shortVersionString=|url=' \ 32 | | head -2 \ 33 | | sort \ 34 | | awk -F'"' '/^/{print $2}')) 35 | 36 | # "Sparkle" will always come before "url" because of "sort" 37 | LATEST_VERSION="$INFO[1]" 38 | URL="$INFO[2]" 39 | 40 | # If any of these are blank, we should not continue 41 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 42 | then 43 | echo "$NAME: Error: bad data received: 44 | INFO: $INFO 45 | LATEST_VERSION: $LATEST_VERSION 46 | URL: $URL 47 | " 48 | 49 | exit 1 50 | fi 51 | 52 | 53 | if [[ -e "$INSTALL_TO" ]] 54 | then 55 | 56 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo '0'` 57 | 58 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 59 | then 60 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 61 | exit 0 62 | fi 63 | 64 | autoload is-at-least 65 | 66 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 67 | 68 | if [ "$?" = "0" ] 69 | then 70 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 71 | exit 0 72 | fi 73 | 74 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 75 | 76 | fi 77 | 78 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.zip" 79 | 80 | echo "$NAME: Downloading $URL to $FILENAME" 81 | 82 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 83 | 84 | EXIT="$?" 85 | 86 | ## exit 22 means 'the file was already fully downloaded' 87 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 88 | 89 | 90 | if [[ -e "$INSTALL_TO" ]] 91 | then 92 | ## Quit app, if running 93 | # pgrep -xq "Clarify" \ 94 | # && LAUNCH='yes' \ 95 | # && osascript -e 'tell application "Clarify" to quit' 96 | 97 | # move installed version to trash 98 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 99 | fi 100 | 101 | echo "$NAME: Installing $FILENAME to $INSTALL_TO:h/" 102 | 103 | # Extract from the .zip file and install (this will leave the .zip file in place) 104 | ditto --noqtn -xk "$FILENAME" "$INSTALL_TO:h/" 105 | 106 | EXIT="$?" 107 | 108 | if [ "$EXIT" = "0" ] 109 | then 110 | echo "$NAME: Installation of $INSTALL_TO was successful." 111 | 112 | [[ "$LAUNCH" == "yes" ]] && open -a "$INSTALL_TO" 113 | 114 | else 115 | echo "$NAME: Installation of $INSTALL_TO failed (ditto \$EXIT = $EXIT)\nThe downloaded file can be found at $FILENAME." 116 | 117 | exit 1 118 | fi 119 | 120 | exit 0 121 | #EOF 122 | -------------------------------------------------------------------------------- /discontinued/di-delibar.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: http://www.shinyfrog.net/delibar_pixa.html 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2018-08-13 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO="/Applications/Delibar.app" 11 | 12 | HOMEPAGE="http://www.delibarapp.com" 13 | 14 | DOWNLOAD_PAGE="" 15 | 16 | SUMMARY="Delibar was a Delicious and Pinboard client for Mac." 17 | 18 | # we don't really need this, since the app is EOL, but why not? 19 | XML_FEED='http://apps.shinynode.com/apps/delibar_appcast.xml' 20 | 21 | if [[ -e "$HOME/.path" ]] 22 | then 23 | source "$HOME/.path" 24 | fi 25 | 26 | URL="http://apps.shinynode.com/apps/update/delibar_1.6.zip" 27 | 28 | LATEST_VERSION="1.6" 29 | 30 | if [[ -e "$INSTALL_TO" ]] 31 | then 32 | 33 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 34 | 35 | autoload is-at-least 36 | 37 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 38 | 39 | VERSION_COMPARE="$?" 40 | 41 | if [ "$VERSION_COMPARE" = "0" ] 42 | then 43 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 44 | exit 0 45 | fi 46 | 47 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 48 | 49 | FIRST_INSTALL='no' 50 | 51 | else 52 | 53 | FIRST_INSTALL='yes' 54 | fi 55 | 56 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.zip" 57 | 58 | 59 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 60 | 61 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 62 | 63 | EXIT="$?" 64 | 65 | ## exit 22 means 'the file was already fully downloaded' 66 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 67 | 68 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 69 | 70 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 71 | 72 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 73 | 74 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 75 | 76 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 77 | 78 | EXIT="$?" 79 | 80 | if [[ "$EXIT" == "0" ]] 81 | then 82 | echo "$NAME: Unzip successful" 83 | else 84 | # failed 85 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 86 | 87 | exit 1 88 | fi 89 | 90 | if [[ -e "$INSTALL_TO" ]] 91 | then 92 | 93 | pgrep -xq "$INSTALL_TO:t:r" \ 94 | && LAUNCH='yes' \ 95 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 96 | 97 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 98 | 99 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 100 | 101 | EXIT="$?" 102 | 103 | if [[ "$EXIT" != "0" ]] 104 | then 105 | 106 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 107 | 108 | exit 1 109 | fi 110 | fi 111 | 112 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 113 | 114 | # Move the file out of the folder 115 | mv -vn "$UNZIP_TO/$INSTALL_TO:t" "$INSTALL_TO" 116 | 117 | EXIT="$?" 118 | 119 | if [[ "$EXIT" = "0" ]] 120 | then 121 | 122 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 123 | 124 | else 125 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 126 | 127 | exit 1 128 | fi 129 | 130 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 131 | 132 | exit 0 133 | #EOF 134 | -------------------------------------------------------------------------------- /discontinued/di-deltawalker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2020-02-21 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/DeltaWalker.app' 16 | 17 | # main.js came from brew cask 18 | # example output: 19 | # https://s3.amazonaws.com/deltawalker/DeltaWalker-2.5.5.dmg 20 | URL=$(curl -sfLS "https://www.deltawalker.com/assets/js/main.js" | awk -F"'" '/\.dmg/{print $2}') 21 | 22 | LATEST_VERSION=$(echo "$URL:t:r" | tr -dc '[0-9]\.') 23 | 24 | # No release notes - https://www.deltawalker.com/new-and-noteworthy comes close but isn't up-to-date 25 | 26 | if [[ -e "$INSTALL_TO" ]] 27 | then 28 | 29 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 30 | 31 | autoload is-at-least 32 | 33 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 34 | 35 | VERSION_COMPARE="$?" 36 | 37 | if [ "$VERSION_COMPARE" = "0" ] 38 | then 39 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 40 | exit 0 41 | fi 42 | 43 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 44 | 45 | FIRST_INSTALL='no' 46 | 47 | if [[ ! -w "$INSTALL_TO" ]] 48 | then 49 | echo "$NAME: '$INSTALL_TO' exists, but you do not have 'write' access to it, therefore you cannot update it." >>/dev/stderr 50 | 51 | exit 2 52 | fi 53 | 54 | else 55 | 56 | FIRST_INSTALL='yes' 57 | fi 58 | 59 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${${LATEST_VERSION}// /}.dmg" 60 | 61 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 62 | 63 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 64 | 65 | EXIT="$?" 66 | 67 | ## exit 22 means 'the file was already fully downloaded' 68 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 69 | 70 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 71 | 72 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 73 | 74 | egrep -q '^Local sha256:$' "$FILENAME:r.txt" 2>/dev/null 75 | 76 | EXIT="$?" 77 | 78 | if [ "$EXIT" = "1" -o ! -e "$FILENAME:r.txt" ] 79 | then 80 | (cd "$FILENAME:h" ; \ 81 | echo "\n\nLocal sha256:" ; \ 82 | shasum -a 256 "$FILENAME:t" \ 83 | ) >>| "$FILENAME:r.txt" 84 | fi 85 | 86 | echo "$NAME: Mounting $FILENAME:" 87 | 88 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 89 | | fgrep -A 1 'mount-point' \ 90 | | tail -1 \ 91 | | sed 's#.*##g ; s#.*##g') 92 | 93 | if [[ "$MNTPNT" == "" ]] 94 | then 95 | echo "$NAME: MNTPNT is empty" 96 | exit 1 97 | else 98 | echo "$NAME: MNTPNT is $MNTPNT" 99 | fi 100 | 101 | if [[ -e "$INSTALL_TO" ]] 102 | then 103 | # Quit app, if running 104 | pgrep -xq "$INSTALL_TO:t:r" \ 105 | && LAUNCH='yes' \ 106 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 107 | 108 | # move installed version to trash 109 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.${INSTALLED_VERSION}_${INSTALLED_BUILD}.app" 110 | 111 | EXIT="$?" 112 | 113 | if [[ "$EXIT" != "0" ]] 114 | then 115 | 116 | echo "$NAME: failed to move '$INSTALL_TO' to '$HOME/.Trash'. ('mv' \$EXIT = $EXIT)" 117 | 118 | exit 1 119 | fi 120 | fi 121 | 122 | echo "$NAME: Installing '$MNTPNT/$INSTALL_TO:t' to '$INSTALL_TO': " 123 | 124 | ditto --noqtn -v "$MNTPNT/$INSTALL_TO:t" "$INSTALL_TO" 125 | 126 | EXIT="$?" 127 | 128 | if [[ "$EXIT" == "0" ]] 129 | then 130 | echo "$NAME: Successfully installed $INSTALL_TO" 131 | else 132 | echo "$NAME: ditto failed" 133 | 134 | exit 1 135 | fi 136 | 137 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 138 | 139 | echo -n "$NAME: Unmounting $MNTPNT: " && diskutil eject "$MNTPNT" 140 | 141 | exit 0 142 | #EOF 143 | -------------------------------------------------------------------------------- /discontinued/di-handbrake-nightly.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: download and install HandBrake nightly 3 | # 4 | # From: Tj Luo.ma 5 | # Mail: luomat at gmail dot com 6 | # Web: http://RhymesWithDiploma.com 7 | # Date: 2014-08-18 8 | 9 | NAME="$0:t:r" 10 | 11 | INSTALL_TO='/Applications/HandBrake Nightly.app' 12 | 13 | if [ -e "$HOME/.path" ] 14 | then 15 | source "$HOME/.path" 16 | else 17 | PATH=/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin 18 | fi 19 | 20 | ## HandBrake has a Sparkle feed, but it seems vastly out of date 21 | # XML_FEED='https://handbrake.fr/appcast_unstable.x86_64.xml' 22 | 23 | 24 | UA='curl/7.21.7 (x86_64-apple-darwin10.8.0) libcurl/7.21.7 OpenSSL/1.0.0d zlib/1.2.5 libidn/1.22' 25 | 26 | 27 | if ((! $+commands[lynx] )) 28 | then 29 | # note: if lynx is a function or alias, it will come back not found 30 | 31 | echo "$NAME: lynx is required but not found in $PATH" 32 | exit 1 33 | fi 34 | 35 | URL=`lynx -listonly -dump -nomargins 'http://handbrake.fr/nightly.php' | fgrep -i .dmg | fgrep -iv "CLI"` 36 | 37 | LATEST_VERSION=`echo "$URL:t:r" | sed 's#HandBrake-##g; s#-osx##g'` 38 | 39 | # If any of these are blank, we should not continue 40 | if [ "$LATEST_VERSION" = "" -o "$URL" = "" ] 41 | then 42 | echo "$NAME: Error: bad data received: 43 | LATEST_VERSION: $LATEST_VERSION 44 | URL: $URL 45 | " 46 | 47 | exit 1 48 | fi 49 | 50 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null | awk '{print $1}' || echo '1.0.0'` 51 | 52 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 53 | then 54 | # No Update Needed 55 | echo "$NAME: Up-To-Date (Installed: $INSTALLED_VERSION and Latest: $LATEST_VERSION)" 56 | exit 0 57 | fi 58 | 59 | echo "$NAME: Out of Date: $INSTALLED_VERSION vs $LATEST_VERSION" 60 | 61 | FILENAME="$HOME/Downloads/$URL:t" 62 | 63 | echo "$NAME: Downloading $URL to $FILENAME" 64 | 65 | curl -A "$UA" --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 66 | 67 | EXIT="$?" 68 | 69 | ## exit 22 means 'the file was already fully downloaded' 70 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 71 | 72 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 73 | 74 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 75 | 76 | 77 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 78 | | fgrep -A 1 'mount-point' \ 79 | | tail -1 \ 80 | | sed 's#.*##g ; s#.*##g') 81 | 82 | 83 | if [ -e "$INSTALL_TO" ] 84 | then 85 | 86 | # move installed version to trash 87 | mv -vf "$INSTALL_TO" "$HOME/.Trash/HandBrake.$INSTALLED_VERSION.app" 88 | fi 89 | 90 | echo "$NAME: Installing $FILENAME to $INSTALL_TO:h/" 91 | 92 | ditto --noqtn -v "$MNTPNT/HandBrake.app" "$INSTALL_TO" 93 | 94 | 95 | EXIT="$?" 96 | 97 | if [ "$EXIT" = "0" ] 98 | then 99 | 100 | echo "$NAME: Successfully updated/installed $INSTALL_TO" 101 | 102 | else 103 | echo "$NAME: ditto failed (\$EXIT = $EXIT)" 104 | 105 | exit 1 106 | fi 107 | 108 | diskutil eject "$MNTPNT" 109 | 110 | 111 | exit 0 112 | 113 | # 114 | #EOF 115 | -------------------------------------------------------------------------------- /discontinued/di-imageoptim-beta.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install the latest version of ImageOptim BETA 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-04-26 7 | 8 | NAME="$0:t:r" 9 | 10 | # Note that we are installing this in a different path/name so it won't conflict with the non-beta version 11 | INSTALL_TO='/Applications/ImageOptimBeta.app' 12 | 13 | if [ -e "$HOME/.path" ] 14 | then 15 | source "$HOME/.path" 16 | else 17 | PATH=/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin 18 | fi 19 | 20 | 21 | # wget -c http://dl.macupdate.com/prod/ImageOptim.zip 22 | # https://imageoptim.com/ImageOptim1.6.1a1.tar.bz2 23 | 24 | # XML_FEED='https://imageoptim.com/appcast.xml' 25 | 26 | XML_FEED='https://imageoptim.com/appcast-test.xml' 27 | 28 | INFO=($(curl -sfL "$XML_FEED" \ 29 | | tr -s ' ' '\012' \ 30 | | egrep 'sparkle:version=|url=' \ 31 | | head -2 \ 32 | | sort \ 33 | | awk -F'"' '/^/{print $2}')) 34 | 35 | # "Sparkle" will always come before "url" because of "sort" 36 | LATEST_VERSION="$INFO[1]" 37 | 38 | URL="$INFO[2]" 39 | 40 | # If any of these are blank, we should not continue 41 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 42 | then 43 | echo "$NAME: Error: bad data received: 44 | INFO: $INFO 45 | LATEST_VERSION: $LATEST_VERSION 46 | URL: $URL 47 | " 48 | 49 | exit 1 50 | fi 51 | 52 | if [[ -e "$INSTALL_TO" ]] 53 | then 54 | 55 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString ` 56 | 57 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 58 | then 59 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 60 | exit 0 61 | fi 62 | 63 | autoload is-at-least 64 | 65 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 66 | 67 | if [ "$?" = "0" ] 68 | then 69 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 70 | exit 0 71 | fi 72 | 73 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 74 | 75 | fi 76 | 77 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.tar.bz2" 78 | 79 | echo "$NAME: Downloading $URL to $FILENAME" 80 | 81 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 82 | 83 | EXIT="$?" 84 | 85 | ## exit 22 means 'the file was already fully downloaded' 86 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download failed (EXIT = $EXIT)" && exit 0 87 | 88 | if [[ -e "$INSTALL_TO" ]] 89 | then 90 | ## Quit app, if running 91 | # pgrep -xq "ImageOptim" \ 92 | # && LAUNCH='yes' \ 93 | # && osascript -e 'tell application "ImageOptim" to quit' 94 | 95 | # move installed version to trash 96 | mv -vf "$INSTALL_TO" "$HOME/.Trash/ImageOptim.$INSTALLED_VERSION.$$.app" 97 | fi 98 | 99 | TEMPDIR=`mktemp -d "${TMPDIR-/tmp/}XXXXXXXX"` 100 | 101 | ## I am installing into a temp directory so that I can use my own custom INSTALL_TO name rather than overwriting the non-beta version 102 | 103 | echo "$NAME: Extracting $FILENAME to $TEMPDIR..." 104 | 105 | tar -x -C "${TEMPDIR}" -j -f "$FILENAME" 106 | 107 | EXIT="$?" 108 | 109 | if [ "$EXIT" != "0" ] 110 | then 111 | 112 | echo "$NAME: 'tar' failed (\$EXIT = $EXIT)" 113 | 114 | exit 1 115 | fi 116 | 117 | mv -vf "$TEMPDIR/ImageOptim.app" "$INSTALL_TO" 118 | 119 | EXIT="$?" 120 | 121 | if [ "$EXIT" = "0" ] 122 | then 123 | 124 | echo "$NAME: Successfully installed $TEMPDIR/ImageOptim.app to $INSTALL_TO" 125 | 126 | else 127 | echo "$NAME: 'mv' failed (\$EXIT = $EXIT)" 128 | 129 | exit 1 130 | fi 131 | 132 | rmdir "$TEMPDIR" 133 | 134 | exit 0 135 | # 136 | #EOF 137 | 138 | -------------------------------------------------------------------------------- /discontinued/di-istatmenus5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install the latest version of iStat Menus 5 (note that v6 is also available) 3 | # Source: https://bjango.com/mac/istatmenus/ 4 | # 5 | # From: Timothy J. Luoma 6 | # Mail: luomat at gmail dot com 7 | # Date: 2018-07-20 8 | 9 | NAME="$0:t:r" 10 | 11 | if [ -e "$HOME/.path" ] 12 | then 13 | source "$HOME/.path" 14 | else 15 | PATH=/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin 16 | fi 17 | 18 | INSTALL_TO="/Applications/iStat Menus 5.app" 19 | 20 | URL=$(curl --silent --location --fail --head http://download.bjango.com/istatmenus5/ \ 21 | | awk -F' |\r' '/Location.*\.zip/{print $2}' \ 22 | | tail -1) 23 | 24 | # That gives us something like this: 25 | # https://files.bjango.com/istatmenus5/istatmenus5.32.zip 26 | # no Build information available 27 | 28 | LATEST_VERSION=$(echo "$URL:t:r" | tr -dc '[0-9]\.') 29 | 30 | if [[ -e "$INSTALL_TO" ]] 31 | then 32 | 33 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 34 | 35 | autoload is-at-least 36 | 37 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 38 | 39 | VERSION_COMPARE="$?" 40 | 41 | if [ "$VERSION_COMPARE" = "0" ] 42 | then 43 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 44 | exit 0 45 | fi 46 | 47 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 48 | 49 | FIRST_INSTALL='no' 50 | 51 | else 52 | 53 | FIRST_INSTALL='yes' 54 | fi 55 | 56 | FILENAME="$HOME/Downloads/iStatMenus-${LATEST_VERSION}.zip" 57 | 58 | echo "$NAME: Downloading \"$URL\" to \"$FILENAME\":" 59 | 60 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 61 | 62 | EXIT="$?" 63 | 64 | ## exit 22 means 'the file was already fully downloaded' 65 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 66 | 67 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 68 | 69 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 70 | 71 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 72 | 73 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 74 | 75 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 76 | 77 | EXIT="$?" 78 | 79 | if [[ "$EXIT" == "0" ]] 80 | then 81 | echo "$NAME: Unzip successful" 82 | else 83 | # failed 84 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 85 | 86 | exit 1 87 | fi 88 | 89 | if [[ -e "$INSTALL_TO" ]] 90 | then 91 | echo "$NAME: Moving existing (old) \"$INSTALL_TO\" to \"$HOME/.Trash/\"." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | mv -vn "$UNZIP_TO/iStat Menus.app" "$INSTALL_TO" 110 | 111 | EXIT="$?" 112 | 113 | if [[ "$EXIT" = "0" ]] 114 | then 115 | 116 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 117 | 118 | else 119 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 120 | 121 | exit 1 122 | fi 123 | 124 | 125 | 126 | exit 0 127 | # 128 | #EOF 129 | -------------------------------------------------------------------------------- /discontinued/di-karabiner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: download and install latest Karabiner -- not to be confused with 'Karabiner-Elements' 3 | # 4 | # From: Tj Luo.ma 5 | # Mail: luomat at gmail dot com 6 | # Web: http://RhymesWithDiploma.com 7 | # Date: 2015-01-14 8 | 9 | NAME="$0:t:r" 10 | 11 | INSTALL_TO='/Applications/Karabiner.app' 12 | 13 | if [ -e "$HOME/.path" ] 14 | then 15 | source "$HOME/.path" 16 | else 17 | PATH=/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin 18 | fi 19 | 20 | ## 21 | ## 2018-09-08 - the XML Feed does not show the latest version. Since it is EOL 22 | ## I will just hard-code the values in. 23 | ## 24 | # XML_FEED='https://pqrs.org/osx/karabiner/files/appcast.xml' 25 | # 26 | # INFO=($(curl -sfL "$XML_FEED" \ 27 | # | tr -s ' ' '\012' \ 28 | # | egrep 'sparkle:version=|url=' \ 29 | # | head -2 \ 30 | # | sort \ 31 | # | awk -F'"' '/^/{print $2}')) 32 | ## "Sparkle" will always come before "url" because of "sort" 33 | 34 | LATEST_VERSION="10.22.0" 35 | URL="https://pqrs.org/osx/karabiner/files/Karabiner-10.22.0.dmg" 36 | RELEASE_NOTES_URL='https://pqrs.org/osx/karabiner/history.html#history' 37 | 38 | if [[ -e "$INSTALL_TO" ]] 39 | then 40 | 41 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo '0'` 42 | 43 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 44 | then 45 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 46 | exit 0 47 | fi 48 | 49 | autoload is-at-least 50 | 51 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 52 | 53 | if [ "$?" = "0" ] 54 | then 55 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 56 | exit 0 57 | fi 58 | 59 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 60 | 61 | fi 62 | 63 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.dmg" 64 | 65 | echo "$NAME: Downloading $URL to $FILENAME" 66 | 67 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 68 | 69 | EXIT="$?" 70 | 71 | ## exit 22 means 'the file was already fully downloaded' 72 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download failed (EXIT = $EXIT)" && exit 0 73 | 74 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 75 | | fgrep -A 1 'mount-point' \ 76 | | tail -1 \ 77 | | sed 's#.*##g ; s#.*##g') 78 | 79 | if [[ "$MNTPNT" == "" ]] 80 | then 81 | echo "$NAME: MNTPNT is empty" 82 | exit 1 83 | fi 84 | 85 | 86 | if [ -e "$INSTALL_TO" ] 87 | then 88 | # Quit app, if running 89 | pgrep -xq "Karabiner" \ 90 | && LAUNCH='yes' \ 91 | && osascript -e 'tell application "Karabiner" to quit' 92 | 93 | # The package installer will take care of moving old version 94 | 95 | fi 96 | 97 | PKG=`find "$MNTPNT" -type f -iname \*.pkg -maxdepth 1 -print` 98 | 99 | if [[ "$PKG" == "" ]] 100 | then 101 | echo "$NAME [failed]: PKG is empty" \ 102 | tee -a "$HOME/Desktop/$NAME.Failed.log" 103 | 104 | exit 0 105 | fi 106 | 107 | # Try 'sudo installer', but if it fails, open pkg in Finder 108 | sudo /usr/sbin/installer -pkg "$PKG" -target / -lang en \ 109 | && diskutil eject "$MNTPNT" \ 110 | || open -R "$PKG" 111 | 112 | exit 0 113 | 114 | # 115 | #EOF 116 | -------------------------------------------------------------------------------- /discontinued/di-logos6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install (or update) the latest version of Logos.com for Mac (note: this is for version 6. Version 7 is also available) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-11-19 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO='/Applications/Logos 6.app' 11 | 12 | if [ -e "$HOME/.path" ] 13 | then 14 | source "$HOME/.path" 15 | else 16 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 17 | fi 18 | 19 | XML_FEED='https://clientservices.logos.com/update/v1/feed/logos6-mac/stable.xml' 20 | 21 | # 22 | #6.7.0.0044 23 | 24 | INFO=($(curl -sfL "$XML_FEED" \ 25 | | tidy \ 26 | --char-encoding utf8 \ 27 | --force-output yes \ 28 | --input-xml yes \ 29 | --markup yes \ 30 | --output-xhtml no \ 31 | --output-xml yes \ 32 | --quiet yes \ 33 | --show-errors 0 \ 34 | --show-warnings no \ 35 | --wrap 0 \ 36 | | egrep 'link href|logos:version' \ 37 | | head -2 \ 38 | | sed 's###g ; s###g ; s#/dev/null || echo '0'` 62 | 63 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 64 | then 65 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 66 | exit 0 67 | fi 68 | 69 | autoload is-at-least 70 | 71 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 72 | 73 | if [ "$?" = "0" ] 74 | then 75 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 76 | exit 0 77 | fi 78 | 79 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 80 | 81 | fi 82 | 83 | FILENAME="$HOME/Downloads/Logos-$LATEST_VERSION.dmg" 84 | 85 | echo "$NAME: Downloading $URL to $FILENAME" 86 | 87 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 88 | 89 | EXIT="$?" 90 | 91 | ## exit 22 means 'the file was already fully downloaded' 92 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download failed (EXIT = $EXIT)" && exit 0 93 | 94 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 95 | | fgrep -A 1 'mount-point' \ 96 | | tail -1 \ 97 | | sed 's#.*##g ; s#.*##g') 98 | 99 | if [[ "$MNTPNT" == "" ]] 100 | then 101 | echo "$NAME: MNTPNT is empty" 102 | exit 1 103 | fi 104 | 105 | 106 | if [ -e "$INSTALL_TO" ] 107 | then 108 | # Quit app, if running 109 | pgrep -xq "Logos" \ 110 | && LAUNCH='yes' \ 111 | && osascript -e 'tell application "Logos" to quit' 112 | 113 | # move installed version to trash 114 | mv -vf "$INSTALL_TO" "$HOME/.Trash/Logos.$INSTALLED_VERSION.app" 115 | fi 116 | 117 | echo "$NAME: Installing $MNTPNT/Logos.app to $INSTALL_TO" 118 | 119 | ditto --noqtn -v "$MNTPNT/Logos.app" "$INSTALL_TO" 120 | 121 | EXIT="$?" 122 | 123 | if [ "$EXIT" = "0" ] 124 | then 125 | 126 | echo "$NAME: Installed $LATEST_VERSION to $INSTALL_TO" 127 | 128 | else 129 | echo "$NAME: ditto --noqtn failed (\$EXIT = $EXIT)" 130 | 131 | exit 1 132 | fi 133 | 134 | diskutil eject "$MNTPNT" 135 | 136 | [[ "$LAUNCH" == "yes" ]] && open "$INSTALL_TO" 137 | 138 | exit 0 139 | #EOF 140 | -------------------------------------------------------------------------------- /discontinued/di-logos7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install the latest version of Logos 7 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2018-07-20 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO='/Applications/Logos.app' 11 | 12 | if [ -e "$HOME/.path" ] 13 | then 14 | source "$HOME/.path" 15 | else 16 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 17 | fi 18 | 19 | # Just like v6 20 | XML_FEED='https://clientservices.logos.com/update/v1/feed/logos7-mac/stable.xml' 21 | 22 | INFO=($(curl -sfL "$XML_FEED" \ 23 | | tidy \ 24 | --char-encoding utf8 \ 25 | --force-output yes \ 26 | --input-xml yes \ 27 | --markup yes \ 28 | --output-xhtml no \ 29 | --output-xml yes \ 30 | --quiet yes \ 31 | --show-errors 0 \ 32 | --show-warnings no \ 33 | --wrap 0 \ 34 | | egrep 'link href|logos:version' \ 35 | | head -2 \ 36 | | sed 's###g ; s###g ; s#/dev/null || echo '0'` 60 | 61 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 62 | then 63 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 64 | exit 0 65 | fi 66 | 67 | autoload is-at-least 68 | 69 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 70 | 71 | if [ "$?" = "0" ] 72 | then 73 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 74 | exit 0 75 | fi 76 | 77 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 78 | 79 | fi 80 | 81 | FILENAME="$HOME/Downloads/Logos-$LATEST_VERSION.dmg" 82 | 83 | echo "$NAME: Downloading $URL to $FILENAME" 84 | 85 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 86 | 87 | EXIT="$?" 88 | 89 | ## exit 22 means 'the file was already fully downloaded' 90 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download failed (EXIT = $EXIT)" && exit 0 91 | 92 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 93 | | fgrep -A 1 'mount-point' \ 94 | | tail -1 \ 95 | | sed 's#.*##g ; s#.*##g') 96 | 97 | if [[ "$MNTPNT" == "" ]] 98 | then 99 | echo "$NAME: MNTPNT is empty" 100 | exit 1 101 | fi 102 | 103 | 104 | if [ -e "$INSTALL_TO" ] 105 | then 106 | # Quit app, if running 107 | pgrep -xq "Logos" \ 108 | && LAUNCH='yes' \ 109 | && osascript -e 'tell application "Logos" to quit' 110 | 111 | # move installed version to trash 112 | mv -vf "$INSTALL_TO" "$HOME/.Trash/Logos.$INSTALLED_VERSION.app" 113 | fi 114 | 115 | echo "$NAME: Installing $MNTPNT/Logos.app to $INSTALL_TO" 116 | 117 | ditto --noqtn -v "$MNTPNT/Logos.app" "$INSTALL_TO" 118 | 119 | EXIT="$?" 120 | 121 | if [ "$EXIT" = "0" ] 122 | then 123 | 124 | echo "$NAME: Installed $LATEST_VERSION to $INSTALL_TO" 125 | 126 | else 127 | echo "$NAME: ditto failed (\$EXIT = $EXIT)" 128 | 129 | exit 1 130 | fi 131 | 132 | diskutil eject "$MNTPNT" 133 | 134 | [[ "$LAUNCH" == "yes" ]] && open "$INSTALL_TO" 135 | 136 | exit 0 137 | #EOF 138 | -------------------------------------------------------------------------------- /discontinued/di-mailplane3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install Mailplane.app (v3) note that v4 is now available 3 | # 4 | # From: Tj Luo.ma 5 | # Mail: luomat at gmail dot com 6 | # Web: http://RhymesWithDiploma.com 7 | # Date: 2015-02-02 8 | 9 | NAME="$0:t:r" 10 | 11 | INSTALL_TO='/Applications/Mailplane 3.app' 12 | 13 | if [ -e "$HOME/.path" ] 14 | then 15 | source "$HOME/.path" 16 | else 17 | PATH=/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin 18 | fi 19 | 20 | URL=$(curl -sfL --head http://update.mailplaneapp.com/mailplane_3.php \ 21 | | awk -F': ' '/^Location/{print $NF}' \ 22 | | tail -1 \ 23 | | tr -d '[:cntrl:]') 24 | 25 | [[ "$URL" == "" ]] && echo "$NAME: Empty URL" && exit 1 26 | 27 | LATEST_VERSION=`echo "$URL:t:r" | sed 's#Mailplane_3_##g'` 28 | 29 | if [[ -e "$INSTALL_TO" ]] 30 | then 31 | 32 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleVersion 2>/dev/null || echo '0'` 33 | 34 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 35 | then 36 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 37 | exit 0 38 | fi 39 | 40 | autoload is-at-least 41 | 42 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 43 | 44 | if [ "$?" = "0" ] 45 | then 46 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 47 | exit 0 48 | fi 49 | 50 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 51 | fi 52 | 53 | FILENAME="$HOME/Downloads/MailPlane-3-${LATEST_VERSION}.tbz" 54 | 55 | echo "$NAME: Downloading $URL to $FILENAME" 56 | 57 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 58 | 59 | EXIT="$?" 60 | 61 | ## exit 22 means 'the file was already fully downloaded' 62 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download failed (EXIT = $EXIT)" && exit 0 63 | 64 | if [[ -e "$INSTALL_TO" ]] 65 | then 66 | # Quit app, if running 67 | pgrep -xq "MailPlane 3" \ 68 | && LAUNCH='yes' \ 69 | && osascript -e 'tell application "MailPlane 3" to quit' 70 | 71 | # move installed version to trash 72 | mv -vf "$INSTALL_TO" "$HOME/.Trash/MailPlane 3.$INSTALLED_VERSION.app" 73 | fi 74 | 75 | echo "$NAME: Installing $FILENAME to $INSTALL_TO:h" 76 | 77 | tar -x -C "$INSTALL_TO:h" -j -f "$FILENAME" 78 | 79 | EXIT="$?" 80 | 81 | if [[ "$EXIT" == "0" ]] 82 | then 83 | echo "$NAME: Installation of $INSTALL_TO was successful." 84 | exit 0 85 | else 86 | echo "$NAME: Installation of $INSTALL_TO failed (\$EXIT = $EXIT)\nThe downloaded file can be found at $FILENAME." 87 | exit 1 88 | fi 89 | 90 | exit 0 91 | # 92 | #EOF 93 | -------------------------------------------------------------------------------- /discontinued/di-omnigraffle6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install the latest version of OmniGraffle 6 (note that v7 is now available at https://www.omnigroup.com/omnigraffle) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2016-05-10 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO='/Applications/OmniGraffle 6.app' 11 | 12 | if [ -e "$HOME/.path" ] 13 | then 14 | source "$HOME/.path" 15 | else 16 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 17 | fi 18 | 19 | LAUNCH='no' 20 | 21 | ## Note: Downloads are available in tbz2 and dmg but dmg has EULA so I use tbz2 22 | 23 | INFO=($(curl -sfL "http://update.omnigroup.com/appcast/com.omnigroup.OmniGraffle6" 2>&1 \ 24 | | sed 's#<#\ 25 | <#g' \ 26 | | tr -s ' ' '\012' \ 27 | | egrep '|url=.*\.tbz2' \ 28 | | head -2 \ 29 | | tr -s '>|"' ' ' \ 30 | | awk '{print $NF}')) 31 | 32 | LATEST_VERSION="$INFO[1]" 33 | 34 | URL="$INFO[2]" 35 | 36 | 37 | # If any of these are blank, we should not continue 38 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 39 | then 40 | echo "$NAME: Error: bad data received: 41 | INFO: $INFO 42 | LATEST_VERSION: $LATEST_VERSION 43 | URL: $URL 44 | " 45 | 46 | exit 1 47 | fi 48 | 49 | 50 | 51 | 52 | 53 | if [[ -e "$INSTALL_TO" ]] 54 | then 55 | 56 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo '0'` 57 | 58 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 59 | then 60 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 61 | exit 0 62 | fi 63 | 64 | autoload is-at-least 65 | 66 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 67 | 68 | if [ "$?" = "0" ] 69 | then 70 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 71 | exit 0 72 | fi 73 | 74 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 75 | 76 | fi 77 | 78 | # No RELEASE_NOTES_URL as it's been replaced by v7 79 | 80 | FILENAME="$HOME/Downloads/OmniGraffle-$LATEST_VERSION.tbz2" 81 | 82 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 83 | 84 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 85 | 86 | EXIT="$?" 87 | 88 | ## exit 22 means 'the file was already fully downloaded' 89 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 90 | 91 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 92 | 93 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 94 | 95 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 96 | 97 | echo "$NAME: Unpacking '$FILENAME' to '$UNZIP_TO':" 98 | 99 | tar -x -C "$UNZIP_TO" -f "$FILENAME" 100 | 101 | EXIT="$?" 102 | 103 | if [[ "$EXIT" != "0" ]] 104 | then 105 | echo "$NAME: tar failed (\$EXIT = $EXIT)" 106 | exit 1 107 | fi 108 | 109 | if [[ -e "$INSTALL_TO" ]] 110 | then 111 | 112 | pgrep -xq "$INSTALL_TO:t:r" \ 113 | && LAUNCH='yes' \ 114 | && osascript -e 'tell application "$INSTALL_TO:t:r" to quit' 115 | 116 | # move installed version to trash 117 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 118 | 119 | EXIT="$?" 120 | 121 | if [[ "$EXIT" != "0" ]] 122 | then 123 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 124 | exit 1 125 | fi 126 | fi 127 | # Note name difference 128 | mv -vf "$UNZIP_TO/OmniGraffle.app" "$INSTALL_TO" 129 | 130 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 131 | 132 | exit 0 133 | 134 | #EOF 135 | -------------------------------------------------------------------------------- /discontinued/di-omnioutliner4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install OmniOutliner 4 (note that version 5 is now available) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-10-26 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO='/Applications/OmniOutliner 4.app' 11 | 12 | LAUNCH='no' 13 | 14 | if [ -e "$HOME/.path" ] 15 | then 16 | source "$HOME/.path" 17 | else 18 | PATH=/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin 19 | fi 20 | 21 | XML_FEED='http://update.omnigroup.com/appcast/com.omnigroup.OmniOutliner4/' 22 | 23 | # Don't indent or you'll break sed 24 | INFO=($(curl -sfL "$XML_FEED" 2>&1 \ 25 | | sed 's#<#\ 26 | <#g' \ 27 | | tr -s ' ' '\012' \ 28 | | egrep '4|url=.*\.tbz2' \ 29 | | head -2 \ 30 | | tr -s '>|"' ' ' \ 31 | | awk '{print $NF}')) 32 | 33 | LATEST_VERSION="$INFO[1]" 34 | 35 | URL="$INFO[2]" 36 | 37 | # If any of these are blank, we should not continue 38 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 39 | then 40 | echo "$NAME: Error: bad data received: 41 | INFO: $INFO 42 | LATEST_VERSION: $LATEST_VERSION 43 | URL: $URL 44 | " 45 | 46 | exit 1 47 | fi 48 | 49 | if [[ -e "$INSTALL_TO" ]] 50 | then 51 | 52 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo '0'` 53 | 54 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 55 | then 56 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 57 | exit 0 58 | fi 59 | 60 | autoload is-at-least 61 | 62 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 63 | 64 | if [ "$?" = "0" ] 65 | then 66 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 67 | exit 0 68 | fi 69 | 70 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 71 | 72 | fi 73 | 74 | # No RELEASE_NOTES_URL available now that v5 is available 🙁 75 | 76 | FILENAME="$HOME/Downloads/OmniOutliner-$LATEST_VERSION.tbz2" 77 | 78 | echo "$NAME: Downloading $URL to $FILENAME" 79 | 80 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 81 | 82 | EXIT="$?" 83 | 84 | ## exit 22 means 'the file was already fully downloaded' 85 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 86 | 87 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 88 | 89 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 90 | 91 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 92 | 93 | echo "$NAME: Unpacking $FILENAME to $UNZIP_TO" 94 | 95 | tar -x -C "$UNZIP_TO" -f "$FILENAME" 96 | 97 | EXIT="$?" 98 | 99 | if [ "$EXIT" != "0" ] 100 | then 101 | echo "$NAME: tar failed (\$EXIT = $EXIT)" 102 | exit 1 103 | fi 104 | 105 | if [[ -e "$INSTALL_TO" ]] 106 | then 107 | 108 | pgrep -xq "$INSTALL_TO:t:r" \ 109 | && LAUNCH='yes' \ 110 | && osascript -e 'tell application "$INSTALL_TO:t:r" to quit' 111 | 112 | # move installed version to trash 113 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 114 | 115 | EXIT="$?" 116 | 117 | if [[ "$EXIT" != "0" ]] 118 | then 119 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 120 | exit 1 121 | fi 122 | fi 123 | 124 | # Note difference in names 125 | mv -vf "$UNZIP_TO//OmniOutliner.app" "$INSTALL_TO/" 126 | 127 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 128 | 129 | exit 0 130 | 131 | #EOF 132 | -------------------------------------------------------------------------------- /discontinued/di-pathfinder7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install the latest version of PathFinder 7 (note: PathFinder 8 is now available) from 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-11-19 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO='/Applications/Path Finder 7.app' 11 | 12 | if [ -e "$HOME/.path" ] 13 | then 14 | source "$HOME/.path" 15 | else 16 | PATH=/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin 17 | fi 18 | 19 | URL="https://get.cocoatech.com/PF7.zip" 20 | 21 | ## I determined LATEST_VERSION by downloading 'https://get.cocoatech.com/PF7.zip' on 2018-07-17 22 | ## I do not think PathFinder 7 will be updated anymore, so this is likely to be the last version 23 | LATEST_VERSION="7.6.2" 24 | 25 | # RELEASE_NOTES_URL - this version is EOL, so no new releases will be coming, so release note support seems superfluous 26 | 27 | if [[ -e "$INSTALL_TO" ]] 28 | then 29 | 30 | INSTALLED_VERSION=$(defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString) 31 | 32 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 33 | then 34 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 35 | exit 0 36 | fi 37 | 38 | autoload is-at-least 39 | 40 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 41 | 42 | if [ "$?" = "0" ] 43 | then 44 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 45 | exit 0 46 | fi 47 | 48 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 49 | 50 | fi 51 | 52 | FILENAME="$HOME/Downloads/PathFinder-${LATEST_VERSION}.zip" 53 | 54 | echo "$NAME: Downloading $URL to $FILENAME" 55 | 56 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 57 | 58 | EXIT="$?" 59 | 60 | ## exit 22 means 'the file was already fully downloaded' 61 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download failed (EXIT = $EXIT)" && exit 0 62 | 63 | if [ -e "$INSTALL_TO" ] 64 | then 65 | # Quit app, if running 66 | pgrep -xq "Path Finder" \ 67 | && LAUNCH='yes' \ 68 | && osascript -e 'tell application "Path Finder" to quit' 69 | 70 | # move installed version to trash 71 | mv -vf "$INSTALL_TO" "$HOME/.Trash/Path Finder.$INSTALLED_VERSION.app" 72 | fi 73 | 74 | echo "$NAME: Installing $FILENAME to $INSTALL_TO:h/" 75 | 76 | # Extract from the .zip file and install (this will leave the .zip file in place) 77 | ditto --noqtn -xk "$FILENAME" "$INSTALL_TO:h/" 78 | 79 | EXIT="$?" 80 | 81 | if [ "$EXIT" = "0" ] 82 | then 83 | echo "$NAME: Installation of $INSTALL_TO was successful." 84 | 85 | [[ "$LAUNCH" == "yes" ]] && open -a "$INSTALL_TO" 86 | 87 | else 88 | echo "$NAME: Installation of $INSTALL_TO failed (\$EXIT = $EXIT)\nThe downloaded file can be found at $FILENAME." 89 | fi 90 | 91 | exit 0 92 | # 93 | 94 | 95 | ## 2018-07-17 - this feed now just has info about PathFinder 8 so we can't use it 96 | #XML_FEED='http://sparkle.cocoatech.com/PF7.xml' 97 | # 98 | # INFO=($(curl -sfL "$XML_FEED" \ 99 | # | egrep '|' \ 100 | # | awk -F'>|<' '//{print $3}')) 101 | # 102 | ## "Sparkle" will always come before "url" because of "sort" 103 | # LATEST_VERSION="$INFO[1]" 104 | # URL="$INFO[2]" 105 | # 106 | # 107 | ## If any of these are blank, we should not continue 108 | # if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 109 | # then 110 | # echo "$NAME: Error: bad data received:\nINFO: $INFO" 111 | # exit 0 112 | # fi 113 | # 114 | #EOF 115 | -------------------------------------------------------------------------------- /discontinued/di-postbox.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: https://www.postbox-inc.com 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-13 7 | # Verified: 2025-02-24 8 | 9 | NAME="$0:t:r" 10 | 11 | if [[ -e "$HOME/.path" ]] 12 | then 13 | source "$HOME/.path" 14 | fi 15 | 16 | INSTALL_TO='/Applications/Postbox.app' 17 | 18 | RELEASE_NOTES_URL='https://www.postbox-inc.com/product/releasenotes' 19 | 20 | # The app is EOL so this is probably safe to hardcode 21 | URL='https://d3nx85trn0lqsg.cloudfront.net/mac/postbox-7.0.65-mac64.dmg' 22 | 23 | LATEST_VERSION=$(echo "$URL:t:r" | sed 's#postbox-##g; s#-mac64##g') 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.dmg" 52 | 53 | if (( $+commands[lynx] )) 54 | then 55 | 56 | (curl -sfLS "$RELEASE_NOTES_URL" \ 57 | | awk '/

Postbox/{i++}i==1' \ 58 | | lynx -dump -nomargins -width='10000' -assume_charset=UTF-8 -pseudo_inlines -stdin ; 59 | echo "\nURL: $URL\nRelease Notes: $RELEASE_NOTES_URL" ) | tee "$FILENAME:r.txt" 60 | 61 | fi 62 | 63 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 64 | 65 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 66 | 67 | EXIT="$?" 68 | 69 | ## exit 22 means 'the file was already fully downloaded' 70 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 71 | 72 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 73 | 74 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 75 | 76 | (cd "$FILENAME:h" ; echo "\n\nLocal sha256:" ; shasum -a 256 "$FILENAME:t" ) >>| "$FILENAME:r.txt" 77 | 78 | echo "$NAME: Accepting EULA and mounting '$FILENAME' (sorry if this opens a Finder window, it's not my fault):" 79 | 80 | MNTPNT=$(echo -n "Y" | hdid -plist "$FILENAME" 2>/dev/null | fgrep '/Volumes/' | sed 's###g ; s#.*##g') 81 | 82 | if [[ "$MNTPNT" == "" ]] 83 | then 84 | echo "$NAME: MNTPNT is empty" 85 | exit 1 86 | else 87 | echo "$NAME: MNTPNT is $MNTPNT" 88 | fi 89 | 90 | if [[ -e "$INSTALL_TO" ]] 91 | then 92 | # Quit app, if running 93 | pgrep -xq "$INSTALL_TO:t:r" \ 94 | && LAUNCH='yes' \ 95 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 96 | 97 | # move installed version to trash 98 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.${INSTALLED_VERSION}_${INSTALLED_BUILD}.app" 99 | fi 100 | 101 | echo "$NAME: Installing '$MNTPNT/$INSTALL_TO:t' to '$INSTALL_TO': " 102 | 103 | ditto --noqtn -v "$MNTPNT/$INSTALL_TO:t" "$INSTALL_TO" 104 | 105 | EXIT="$?" 106 | 107 | if [[ "$EXIT" == "0" ]] 108 | then 109 | echo "$NAME: Successfully installed $INSTALL_TO" 110 | else 111 | echo "$NAME: ditto failed" 112 | 113 | exit 1 114 | fi 115 | 116 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 117 | 118 | echo -n "$NAME: Unmounting $MNTPNT: " && diskutil eject "$MNTPNT" 119 | 120 | exit 0 121 | #EOF 122 | -------------------------------------------------------------------------------- /discontinued/di-printopia2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Download and install latest version of Printopia 2 (note there is a separate script for v3) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-12-07 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO="$HOME/Library/PreferencePanes/Printopia.prefPane" 11 | 12 | if [ -e "$HOME/.path" ] 13 | then 14 | source "$HOME/.path" 15 | else 16 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 17 | fi 18 | 19 | XML_FEED='https://www.decisivetactics.com/products/printopia/appcast' 20 | 21 | INFO=($(curl -sfL "$XML_FEED" \ 22 | | tr -s ' ' '\012' \ 23 | | egrep 'sparkle:shortVersionString=|url=' \ 24 | | head -2 \ 25 | | sort \ 26 | | awk -F'"' '/^/{print $2}')) 27 | 28 | # "Sparkle" will always come before "url" because of "sort" 29 | LATEST_VERSION="$INFO[1]" 30 | URL="$INFO[2]" 31 | 32 | # If any of these are blank, we should not continue 33 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 34 | then 35 | echo "$NAME: Error: bad data received: 36 | INFO: $INFO 37 | LATEST_VERSION: $LATEST_VERSION 38 | URL: $URL 39 | " 40 | 41 | exit 1 42 | fi 43 | 44 | if [[ -e "$INSTALL_TO" ]] 45 | then 46 | 47 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo '0'` 48 | 49 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 50 | then 51 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 52 | exit 0 53 | fi 54 | 55 | autoload is-at-least 56 | 57 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 58 | 59 | if [ "$?" = "0" ] 60 | then 61 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 62 | exit 0 63 | fi 64 | 65 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 66 | fi 67 | 68 | # No RELEASE_NOTES_URL as it's been replaced by v3 69 | 70 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-${LATEST_VERSION}.zip" 71 | 72 | echo "$NAME: Downloading $URL to $FILENAME" 73 | 74 | curl --continue-at - --progress-bar --fail --location --output "$FILENAME" "$URL" 75 | 76 | EXIT="$?" 77 | 78 | ## exit 22 means 'the file was already fully downloaded' 79 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 80 | 81 | if [ -e "$INSTALL_TO" ] 82 | then 83 | # Quit app, if running 84 | osascript -e 'tell application "Printopia Server" to quit' 85 | 86 | # move installed version to trash 87 | mv -vf "$INSTALL_TO" "$HOME/.Trash/Printopia-$INSTALLED_VERSION.prefPane" 88 | fi 89 | 90 | TEMPDIR="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM" 91 | 92 | # Extract from the .zip file and open in temp dir 93 | ditto --noqtn -xk "$FILENAME" "$TEMPDIR" 94 | 95 | NEW=`find "$TEMPDIR" -iname 'Printopia.prefPane' -print -type d` 96 | 97 | echo "NEW: >$NEW<" 98 | 99 | ditto --noqtn -v "$NEW" "$INSTALL_TO" 100 | 101 | 102 | EXIT="$?" 103 | 104 | if [ "$EXIT" = "0" ] 105 | then 106 | 107 | echo "$NAME Installation/update of $INSTALL_TO successful" 108 | 109 | else 110 | echo "$NAME: ditto failed (\$EXIT = $EXIT)" 111 | 112 | exit 1 113 | fi 114 | 115 | SERVER="$INSTALL_TO/Contents/MacOS/Printopia Server.app" 116 | 117 | echo "$NAME: starting $SERVER" 118 | 119 | open "$SERVER" 120 | 121 | exit 0 122 | #EOF 123 | -------------------------------------------------------------------------------- /discontinued/di-seil.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Download and install the latest version of Seil, which is no longer developed: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2015-11-14 7 | 8 | NAME="$0:t:r" 9 | 10 | INSTALL_TO='/Applications/Seil.app' 11 | 12 | HOMEPAGE="https://pqrs.org/osx/karabiner/seil.html" 13 | 14 | DOWNLOAD_PAGE="https://pqrs.org/osx/karabiner/seil.html" 15 | 16 | SUMMARY="Utility for the caps lock key and some international keys in PC keyboards. (macOS Sierra users: Seil functions are integraded to Karabiner-Elements. Please use Karabiner-Elements.)" 17 | 18 | if [ -e "$HOME/.path" ] 19 | then 20 | source "$HOME/.path" 21 | else 22 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 23 | fi 24 | 25 | XML_FEED='https://pqrs.org/osx/karabiner/files/seil-appcast.xml' 26 | 27 | # XML_FEED='https://pqrs.org/osx/karabiner/files/seil-appcast-devel.xml' 28 | 29 | # only sparkle:version is in the feed 30 | 31 | INFO=($(curl -sfL "$XML_FEED" \ 32 | | tr -s ' ' '\012' \ 33 | | egrep 'sparkle:version=|url=' \ 34 | | head -2 \ 35 | | sort \ 36 | | awk -F'"' '/^/{print $2}')) 37 | 38 | # "Sparkle" will always come before "url" because of "sort" 39 | LATEST_VERSION="$INFO[1]" 40 | 41 | URL="$INFO[2]" 42 | 43 | # If any of these are blank, we should not continue 44 | if [ "$INFO" = "" -o "$LATEST_VERSION" = "" -o "$URL" = "" ] 45 | then 46 | echo "$NAME: Error: bad data received: 47 | INFO: $INFO 48 | LATEST_VERSION: $LATEST_VERSION 49 | URL: $URL 50 | " 51 | exit 1 52 | fi 53 | 54 | if [[ -e "$INSTALL_TO" ]] 55 | then 56 | 57 | INSTALLED_VERSION=`defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo '0'` 58 | 59 | if [[ "$LATEST_VERSION" == "$INSTALLED_VERSION" ]] 60 | then 61 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 62 | exit 0 63 | fi 64 | 65 | autoload is-at-least 66 | 67 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 68 | 69 | if [ "$?" = "0" ] 70 | then 71 | echo "$NAME: Installed version ($INSTALLED_VERSION) is ahead of official version $LATEST_VERSION" 72 | exit 0 73 | fi 74 | 75 | echo "$NAME: Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)" 76 | 77 | fi 78 | 79 | # No RELEASE_NOTES_URL since it's EOL 80 | 81 | FILENAME="$HOME/Downloads/$INSTALL_TO:t:r-$LATEST_VERSION.dmg" 82 | 83 | echo "$NAME: Downloading $URL to $FILENAME" 84 | 85 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 86 | 87 | MNTPNT=$(hdiutil attach -nobrowse -plist "$FILENAME" 2>/dev/null \ 88 | | fgrep -A 1 'mount-point' \ 89 | | tail -1 \ 90 | | sed 's#.*##g ; s#.*##g') 91 | 92 | PKG=`find "$MNTPNT" -iname \*.pkg -maxdepth 1 -print | head -1` 93 | 94 | if (( $+commands[pkginstall.sh] )) 95 | then 96 | pkginstall.sh "$PKG" 97 | 98 | else 99 | sudo /usr/sbin/installer -pkg "$PKG" -target / -lang en || open -R "$PKG" 100 | fi 101 | 102 | if (( $+commands[unmount.sh] )) 103 | then 104 | unmount.sh "$MNTPNT" 105 | else 106 | diskutil eject "$MNTPNT" 107 | fi 108 | 109 | exit 0 110 | #EOF 111 | -------------------------------------------------------------------------------- /discontinued/di-turboboostswitcherpro.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2020-01-14 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/Turbo Boost Switcher Pro.app' 16 | 17 | LATEST_VERSION=$(curl -sfLS "https://api.rugarciap.com/tbs_version_pro" \ 18 | -H "Accept: */*" \ 19 | -H "Accept-Language: en-us" \ 20 | -H "User-Agent: Turbo%20Boost%20Switcher%20Pro/1 CFNetwork/1121.1.2 Darwin/19.2.0 (x86_64)") 21 | 22 | # 291 23 | 24 | if [[ -e "$INSTALL_TO" ]] 25 | then 26 | 27 | INSTALLED_VERSION=$(defaults read "$INSTALL_TO/Contents/Info" CFBundleShortVersionString | tr -dc '[0-9]') 28 | 29 | autoload is-at-least 30 | 31 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 32 | 33 | VERSION_COMPARE="$?" 34 | 35 | if [ "$VERSION_COMPARE" = "0" ] 36 | then 37 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 38 | exit 0 39 | fi 40 | 41 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 42 | 43 | FIRST_INSTALL='no' 44 | 45 | if [[ ! -w "$INSTALL_TO" ]] 46 | then 47 | echo "$NAME: '$INSTALL_TO' exists, but you do not have 'write' access to it, therefore you cannot update it." >>/dev/stderr 48 | 49 | exit 2 50 | fi 51 | 52 | else 53 | FIRST_INSTALL='yes' 54 | 55 | echo "$NAME: Cannot do a clean install without an URL" 56 | exit 0 57 | fi 58 | 59 | growlnotify --sticky \ 60 | --appIcon "$INSTALL_TO:t" \ 61 | --identifier "$NAME" \ 62 | --message "New version of 'Turbo Boost Switcher Pro' available" \ 63 | --title "$LATEST_VERSION (vs $INSTALLED_VERSION)" 64 | 65 | exit 0 66 | #EOF 67 | -------------------------------------------------------------------------------- /hoakleyelc/di-apfelstrudel.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/Apfelstrudel.app' 16 | 17 | HOMEPAGE='https://eclecticlight.co/text-utilities-nalaprop-dystextia-and-others/' 18 | 19 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 20 | 21 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 22 | 23 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -i -B1 ' Apfelstrudel$' | awk '{print $NF}' | head -1) 24 | 25 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -i -A1 ' Apfelstrudel$' | awk '{print $NF}' | tail -1) 26 | 27 | if [[ -e "$INSTALL_TO" ]] 28 | then 29 | 30 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 31 | 32 | autoload is-at-least 33 | 34 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 35 | 36 | VERSION_COMPARE="$?" 37 | 38 | if [ "$VERSION_COMPARE" = "0" ] 39 | then 40 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 41 | exit 0 42 | fi 43 | 44 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 45 | 46 | FIRST_INSTALL='no' 47 | 48 | else 49 | 50 | FIRST_INSTALL='yes' 51 | fi 52 | 53 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 54 | 55 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 56 | 57 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 58 | 59 | EXIT="$?" 60 | 61 | ## exit 22 means 'the file was already fully downloaded' 62 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 63 | 64 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 65 | 66 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 67 | 68 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 69 | 70 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 71 | 72 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 73 | 74 | EXIT="$?" 75 | 76 | if [[ "$EXIT" == "0" ]] 77 | then 78 | echo "$NAME: Unzip successful" 79 | else 80 | # failed 81 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 82 | 83 | exit 1 84 | fi 85 | 86 | if [[ -e "$INSTALL_TO" ]] 87 | then 88 | 89 | pgrep -xq "$INSTALL_TO:t:r" \ 90 | && LAUNCH='yes' \ 91 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 92 | 93 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 94 | 95 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 96 | 97 | EXIT="$?" 98 | 99 | if [[ "$EXIT" != "0" ]] 100 | then 101 | 102 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 103 | 104 | exit 1 105 | fi 106 | fi 107 | 108 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 109 | 110 | # Move the file out of the folder 111 | # note that the '/*/' is to go inside whatever subfolder is created 112 | # this is something all 'eclecticapps' apps do but most other apps do not 113 | 114 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 115 | 116 | EXIT="$?" 117 | 118 | if [[ "$EXIT" = "0" ]] 119 | then 120 | 121 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | else 124 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 125 | 126 | exit 1 127 | fi 128 | 129 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 130 | 131 | exit 0 132 | #EOF 133 | -------------------------------------------------------------------------------- /hoakleyelc/di-cirrus.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Consolation – a log browser for macOS Sierra, High Sierra, and Mojave - https://eclecticlight.co/consolation-t2m2-and-log-utilities/ 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/Cirrus.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' Cirrus$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' Cirrus$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/Cirrus-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /hoakleyelc/di-consolation.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Consolation – a log browser for macOS Sierra, High Sierra, and Mojave - https://eclecticlight.co/consolation-t2m2-and-log-utilities/ 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/Consolation3.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' Consolation$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' Consolation$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/Consolation-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /hoakleyelc/di-delighted.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/DelightEd.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' DelightEd$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' DelightEd$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /hoakleyelc/di-dintch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Dintch – check the integrity of your files 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2020-04-15 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | HOMEPAGE='https://eclecticlight.co/dintch/' 16 | 17 | INSTALL_TO='/Applications/Dintch.app' 18 | 19 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 20 | 21 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 22 | 23 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' Dintch$' | awk '{print $NF}' | head -1) 24 | 25 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' Dintch$' | awk '{print $NF}' | tail -1) 26 | 27 | if [[ -e "$INSTALL_TO" ]] 28 | then 29 | 30 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 31 | 32 | autoload is-at-least 33 | 34 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 35 | 36 | VERSION_COMPARE="$?" 37 | 38 | if [ "$VERSION_COMPARE" = "0" ] 39 | then 40 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 41 | exit 0 42 | fi 43 | 44 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 45 | 46 | FIRST_INSTALL='no' 47 | 48 | else 49 | 50 | FIRST_INSTALL='yes' 51 | fi 52 | 53 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 54 | 55 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 56 | 57 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 58 | 59 | EXIT="$?" 60 | 61 | ## exit 22 means 'the file was already fully downloaded' 62 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 63 | 64 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 65 | 66 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 67 | 68 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 69 | 70 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 71 | 72 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 73 | 74 | EXIT="$?" 75 | 76 | if [[ "$EXIT" == "0" ]] 77 | then 78 | echo "$NAME: Unzip successful" 79 | else 80 | # failed 81 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 82 | 83 | exit 1 84 | fi 85 | 86 | if [[ -e "$INSTALL_TO" ]] 87 | then 88 | 89 | pgrep -xq "$INSTALL_TO:t:r" \ 90 | && LAUNCH='yes' \ 91 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 92 | 93 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 94 | 95 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 96 | 97 | EXIT="$?" 98 | 99 | if [[ "$EXIT" != "0" ]] 100 | then 101 | 102 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 103 | 104 | exit 1 105 | fi 106 | fi 107 | 108 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 109 | 110 | # Move the file out of the folder 111 | # note that the '/*/' is to go inside whatever subfolder is created 112 | # this is something all 'eclecticapps' apps do but most other apps do not 113 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 114 | 115 | EXIT="$?" 116 | 117 | if [[ "$EXIT" = "0" ]] 118 | then 119 | 120 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 121 | 122 | else 123 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 124 | 125 | exit 1 126 | fi 127 | 128 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 129 | 130 | exit 0 131 | #EOF 132 | 133 | 134 | 135 | 136 | exit 0 137 | #EOF 138 | -------------------------------------------------------------------------------- /hoakleyelc/di-dystextia.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/Dystextia.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -i -B1 ' dystextia$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -i -A1 ' dystextia$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /hoakleyelc/di-fintch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Dintch – check the integrity of your files 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2020-04-15 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | HOMEPAGE='https://eclecticlight.co/dintch/' 16 | 17 | INSTALL_TO='/Applications/Fintch.app' 18 | 19 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 20 | 21 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 22 | 23 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' Fintch$' | awk '{print $NF}' | head -1) 24 | 25 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' Fintch$' | awk '{print $NF}' | tail -1) 26 | 27 | if [[ -e "$INSTALL_TO" ]] 28 | then 29 | 30 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 31 | 32 | autoload is-at-least 33 | 34 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 35 | 36 | VERSION_COMPARE="$?" 37 | 38 | if [ "$VERSION_COMPARE" = "0" ] 39 | then 40 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 41 | exit 0 42 | fi 43 | 44 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 45 | 46 | FIRST_INSTALL='no' 47 | 48 | else 49 | 50 | FIRST_INSTALL='yes' 51 | fi 52 | 53 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 54 | 55 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 56 | 57 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 58 | 59 | EXIT="$?" 60 | 61 | ## exit 22 means 'the file was already fully downloaded' 62 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 63 | 64 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 65 | 66 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 67 | 68 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 69 | 70 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 71 | 72 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 73 | 74 | EXIT="$?" 75 | 76 | if [[ "$EXIT" == "0" ]] 77 | then 78 | echo "$NAME: Unzip successful" 79 | else 80 | # failed 81 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 82 | 83 | exit 1 84 | fi 85 | 86 | if [[ -e "$INSTALL_TO" ]] 87 | then 88 | 89 | pgrep -xq "$INSTALL_TO:t:r" \ 90 | && LAUNCH='yes' \ 91 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 92 | 93 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 94 | 95 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 96 | 97 | EXIT="$?" 98 | 99 | if [[ "$EXIT" != "0" ]] 100 | then 101 | 102 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 103 | 104 | exit 1 105 | fi 106 | fi 107 | 108 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 109 | 110 | # Move the file out of the folder 111 | # note that the '/*/' is to go inside whatever subfolder is created 112 | # this is something all 'eclecticapps' apps do but most other apps do not 113 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 114 | 115 | EXIT="$?" 116 | 117 | if [[ "$EXIT" = "0" ]] 118 | then 119 | 120 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 121 | 122 | else 123 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 124 | 125 | exit 1 126 | fi 127 | 128 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 129 | 130 | exit 0 131 | #EOF 132 | 133 | 134 | 135 | 136 | exit 0 137 | #EOF 138 | -------------------------------------------------------------------------------- /hoakleyelc/di-lockrattler.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/LockRattler.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' LockRattler$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' LockRattler$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /hoakleyelc/di-permissionscanner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: PermissionScanner – searches folders for files which are either not writable or not readable 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | HOMEPAGE='https://eclecticlight.co/keychains-permissions' 16 | 17 | INSTALL_TO='/Applications/PermissionScanner.app' 18 | 19 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 20 | 21 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 22 | 23 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' PermissionScanner$' | awk '{print $NF}' | head -1) 24 | 25 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' PermissionScanner$' | awk '{print $NF}' | tail -1) 26 | 27 | if [[ -e "$INSTALL_TO" ]] 28 | then 29 | 30 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 31 | 32 | autoload is-at-least 33 | 34 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 35 | 36 | VERSION_COMPARE="$?" 37 | 38 | if [ "$VERSION_COMPARE" = "0" ] 39 | then 40 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 41 | exit 0 42 | fi 43 | 44 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 45 | 46 | FIRST_INSTALL='no' 47 | 48 | else 49 | 50 | FIRST_INSTALL='yes' 51 | fi 52 | 53 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 54 | 55 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 56 | 57 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 58 | 59 | EXIT="$?" 60 | 61 | ## exit 22 means 'the file was already fully downloaded' 62 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 63 | 64 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 65 | 66 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 67 | 68 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 69 | 70 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 71 | 72 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 73 | 74 | EXIT="$?" 75 | 76 | if [[ "$EXIT" == "0" ]] 77 | then 78 | echo "$NAME: Unzip successful" 79 | else 80 | # failed 81 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 82 | 83 | exit 1 84 | fi 85 | 86 | if [[ -e "$INSTALL_TO" ]] 87 | then 88 | 89 | pgrep -xq "$INSTALL_TO:t:r" \ 90 | && LAUNCH='yes' \ 91 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 92 | 93 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 94 | 95 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 96 | 97 | EXIT="$?" 98 | 99 | if [[ "$EXIT" != "0" ]] 100 | then 101 | 102 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 103 | 104 | exit 1 105 | fi 106 | fi 107 | 108 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 109 | 110 | # Move the file out of the folder 111 | # note that the '/*/' is to go inside whatever subfolder is created 112 | # this is something all 'eclecticapps' apps do but most other apps do not 113 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 114 | 115 | EXIT="$?" 116 | 117 | if [[ "$EXIT" = "0" ]] 118 | then 119 | 120 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 121 | 122 | else 123 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 124 | 125 | exit 1 126 | fi 127 | 128 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 129 | 130 | exit 0 131 | #EOF 132 | -------------------------------------------------------------------------------- /hoakleyelc/di-podofyllin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/Podofyllin.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' Podofyllin$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' Podofyllin$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /hoakleyelc/di-revisionist.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/Revisionist.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' Revisionist$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' Revisionist$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /hoakleyelc/di-signet.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/Signet.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -i -B1 ' signet$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -i -A1 ' signet$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /hoakleyelc/di-systhist.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/SystHist.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' SystHist$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' SystHist$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /hoakleyelc/di-taccy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: Taccy – troubleshoot privacy problems 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-07-26 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | HOMEPAGE='https://eclecticlight.co/taccy-signet-precize-alifix-utiutility-alisma/' 16 | 17 | INSTALL_TO='/Applications/Taccy.app' 18 | 19 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 20 | 21 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 22 | 23 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' Taccy$' | awk '{print $NF}' | head -1) 24 | 25 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' Taccy$' | awk '{print $NF}' | tail -1) 26 | 27 | if [[ -e "$INSTALL_TO" ]] 28 | then 29 | 30 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 31 | 32 | autoload is-at-least 33 | 34 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 35 | 36 | VERSION_COMPARE="$?" 37 | 38 | if [ "$VERSION_COMPARE" = "0" ] 39 | then 40 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 41 | exit 0 42 | fi 43 | 44 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 45 | 46 | FIRST_INSTALL='no' 47 | 48 | else 49 | 50 | FIRST_INSTALL='yes' 51 | fi 52 | 53 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 54 | 55 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 56 | 57 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 58 | 59 | EXIT="$?" 60 | 61 | ## exit 22 means 'the file was already fully downloaded' 62 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 63 | 64 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 65 | 66 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 67 | 68 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 69 | 70 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 71 | 72 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 73 | 74 | EXIT="$?" 75 | 76 | if [[ "$EXIT" == "0" ]] 77 | then 78 | echo "$NAME: Unzip successful" 79 | else 80 | # failed 81 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 82 | 83 | exit 1 84 | fi 85 | 86 | if [[ -e "$INSTALL_TO" ]] 87 | then 88 | 89 | pgrep -xq "$INSTALL_TO:t:r" \ 90 | && LAUNCH='yes' \ 91 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 92 | 93 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 94 | 95 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 96 | 97 | EXIT="$?" 98 | 99 | if [[ "$EXIT" != "0" ]] 100 | then 101 | 102 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 103 | 104 | exit 1 105 | fi 106 | fi 107 | 108 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 109 | 110 | # Move the file out of the folder 111 | # note that the '/*/' is to go inside whatever subfolder is created 112 | # this is something all 'eclecticapps' apps do but most other apps do not 113 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 114 | 115 | EXIT="$?" 116 | 117 | if [[ "$EXIT" = "0" ]] 118 | then 119 | 120 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 121 | 122 | else 123 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 124 | 125 | exit 1 126 | fi 127 | 128 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 129 | 130 | exit 0 131 | #EOF 132 | -------------------------------------------------------------------------------- /hoakleyelc/di-thetimemachinemechanic.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2019-06-05 7 | 8 | NAME="$0:t:r" 9 | 10 | if [[ -e "$HOME/.path" ]] 11 | then 12 | source "$HOME/.path" 13 | fi 14 | 15 | INSTALL_TO='/Applications/TheTimeMachineMechanic.app' 16 | 17 | TEMPFILE="${TMPDIR-/tmp}/${NAME}.$$.$RANDOM.plist" 18 | 19 | curl -sfLS "https://raw.githubusercontent.com/hoakleyelc/updates/master/eclecticapps.plist" > "$TEMPFILE" || exit 1 20 | 21 | LATEST_VERSION=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -B1 -i ' T2M2$' | awk '{print $NF}' | head -1) 22 | 23 | URL=$(/usr/libexec/PlistBuddy -c print "$TEMPFILE" | egrep -A1 -i ' T2M2$' | awk '{print $NF}' | tail -1) 24 | 25 | if [[ -e "$INSTALL_TO" ]] 26 | then 27 | 28 | INSTALLED_VERSION=$(defaults read "${INSTALL_TO}/Contents/Info" CFBundleShortVersionString) 29 | 30 | autoload is-at-least 31 | 32 | is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION" 33 | 34 | VERSION_COMPARE="$?" 35 | 36 | if [ "$VERSION_COMPARE" = "0" ] 37 | then 38 | echo "$NAME: Up-To-Date ($INSTALLED_VERSION)" 39 | exit 0 40 | fi 41 | 42 | echo "$NAME: Outdated: $INSTALLED_VERSION vs $LATEST_VERSION" 43 | 44 | FIRST_INSTALL='no' 45 | 46 | else 47 | 48 | FIRST_INSTALL='yes' 49 | fi 50 | 51 | FILENAME="$HOME/Downloads/${${INSTALL_TO:t:r}// /}-${LATEST_VERSION}.zip" 52 | 53 | echo "$NAME: Downloading '$URL' to '$FILENAME':" 54 | 55 | curl --continue-at - --fail --location --output "$FILENAME" "$URL" 56 | 57 | EXIT="$?" 58 | 59 | ## exit 22 means 'the file was already fully downloaded' 60 | [ "$EXIT" != "0" -a "$EXIT" != "22" ] && echo "$NAME: Download of $URL failed (EXIT = $EXIT)" && exit 0 61 | 62 | [[ ! -e "$FILENAME" ]] && echo "$NAME: $FILENAME does not exist." && exit 0 63 | 64 | [[ ! -s "$FILENAME" ]] && echo "$NAME: $FILENAME is zero bytes." && rm -f "$FILENAME" && exit 0 65 | 66 | UNZIP_TO=$(mktemp -d "${TMPDIR-/tmp/}${NAME}-XXXXXXXX") 67 | 68 | echo "$NAME: Unzipping '$FILENAME' to '$UNZIP_TO':" 69 | 70 | ditto -xk --noqtn "$FILENAME" "$UNZIP_TO" 71 | 72 | EXIT="$?" 73 | 74 | if [[ "$EXIT" == "0" ]] 75 | then 76 | echo "$NAME: Unzip successful" 77 | else 78 | # failed 79 | echo "$NAME failed (ditto -xkv '$FILENAME' '$UNZIP_TO')" 80 | 81 | exit 1 82 | fi 83 | 84 | if [[ -e "$INSTALL_TO" ]] 85 | then 86 | 87 | pgrep -xq "$INSTALL_TO:t:r" \ 88 | && LAUNCH='yes' \ 89 | && osascript -e "tell application \"$INSTALL_TO:t:r\" to quit" 90 | 91 | echo "$NAME: Moving existing (old) '$INSTALL_TO' to '$HOME/.Trash/'." 92 | 93 | mv -vf "$INSTALL_TO" "$HOME/.Trash/$INSTALL_TO:t:r.$INSTALLED_VERSION.app" 94 | 95 | EXIT="$?" 96 | 97 | if [[ "$EXIT" != "0" ]] 98 | then 99 | 100 | echo "$NAME: failed to move existing $INSTALL_TO to $HOME/.Trash/" 101 | 102 | exit 1 103 | fi 104 | fi 105 | 106 | echo "$NAME: Moving new version of '$INSTALL_TO:t' (from '$UNZIP_TO') to '$INSTALL_TO'." 107 | 108 | # Move the file out of the folder 109 | # note that the '/*/' is to go inside whatever subfolder is created 110 | # this is something all 'eclecticapps' apps do but most other apps do not 111 | mv -vn "${UNZIP_TO}"/*/"$INSTALL_TO:t" "$INSTALL_TO" 112 | 113 | EXIT="$?" 114 | 115 | if [[ "$EXIT" = "0" ]] 116 | then 117 | 118 | echo "$NAME: Successfully installed '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 119 | 120 | else 121 | echo "$NAME: Failed to move '$UNZIP_TO/$INSTALL_TO:t' to '$INSTALL_TO'." 122 | 123 | exit 1 124 | fi 125 | 126 | [[ "$LAUNCH" = "yes" ]] && open -a "$INSTALL_TO" 127 | 128 | exit 0 129 | #EOF 130 | -------------------------------------------------------------------------------- /img/github-raw.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjluoma/di/9f71874299a08de5b3d5450bfb58331eddad074d/img/github-raw.jpg -------------------------------------------------------------------------------- /launchd/README.md: -------------------------------------------------------------------------------- 1 | 2 | The purpose of `com.tjluoma.di-auto.sh` is to create a `launchd` plist which will run [di-auto.sh --update](https://github.com/tjluoma/di/blob/master/di-auto.sh) once a day, which will automatically look for all updates using the `di-` scripts, but only for apps which are already installed. 3 | 4 | The easiest way to install this is to copy/paste this into Terminal.app: 5 | 6 | /bin/zsh -c "$(curl -sfL https://raw.githubusercontent.com/tjluoma/di/master/launchd/com.tjluoma.di-auto.sh)" 7 | 8 | That will create and load the launchd plist for you. 9 | 10 | See [com.tjluoma.di-auto.sh](https://github.com/tjluoma/di/blob/master/launchd/com.tjluoma.di-auto.sh) for more details. 11 | -------------------------------------------------------------------------------- /launchd/com.tjluoma.di-auto.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: Run 'di-auto.sh' every day (assuming it is found in $PATH) 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2018-08-06 7 | 8 | NAME="$0:t:r" 9 | 10 | if [ -e "$HOME/.path" ] 11 | then 12 | source "$HOME/.path" 13 | else 14 | PATH=/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin 15 | fi 16 | 17 | ERROR_LOG="$HOME/Desktop/com.tjluoma.di-auto.log" 18 | 19 | [ -e "${ERROR_LOG}" -a ! -s "${ERROR_LOG}" ] && rm -fv "${ERROR_LOG}" 20 | 21 | function write_plist { 22 | 23 | PLIST="$HOME/Library/LaunchAgents/com.tjluoma.di-auto.plist" 24 | 25 | if [[ -e "$PLIST" ]] 26 | then 27 | echo "$NAME: $PLIST already exists." 28 | else 29 | 30 | cat < "$PLIST" 31 | 32 | 33 | 34 | 35 | Label 36 | com.tjluoma.di-auto 37 | LowPriorityBackgroundIO 38 | 39 | LowPriorityIO 40 | 41 | ProcessType 42 | Standard 43 | ProgramArguments 44 | 45 | ${DI_AUTO_PATH} 46 | 47 | StandardErrorPath 48 | ${ERROR_LOG} 49 | StandardOutPath 50 | /tmp/com.tjluoma.di-auto.log 51 | StartInterval 52 | 86400 53 | 54 | 55 | EOINPUT 56 | 57 | /bin/launchctl load "$PLIST" 58 | 59 | fi 60 | 61 | } 62 | 63 | if (( $+commands[di-auto.sh] )) 64 | then 65 | 66 | DI_AUTO_PATH=`which di-auto.sh` 67 | 68 | write_plist 69 | 70 | else 71 | 72 | (echo "'di-auto.sh' not found in $PATH"; 73 | echo "You can download 'di-auto.sh' from 'https://raw.githubusercontent.com/tjluoma/di/master/di-auto.sh'") 2>&1 \ 74 | | tee -a "$ERROR_LOG" 75 | fi 76 | 77 | [ -e "${ERROR_LOG}" -a ! -s "${ERROR_LOG}" ] && rm -fv "${ERROR_LOG}" 78 | 79 | [ -e "${ERROR_LOG}" ] && open "${ERROR_LOG}" 80 | 81 | exit 0 82 | # EOF 83 | -------------------------------------------------------------------------------- /launchd/old/README.md: -------------------------------------------------------------------------------- 1 | The file `com.tjluoma.di-all.plist` must be installed at `$HOME/Library/LaunchAgents` where "$HOME" stands for your home directory, such as 2 | 3 | /Users/JSmith/Library/LaunchAgents/com.tjluoma.di-all.plist 4 | 5 | To load it, you either have to a) log out and log in again, or b) use Terminal: 6 | 7 | launchctl load $HOME/Library/LaunchAgents/com.tjluoma.di-all.plist 8 | 9 | ## Command-line Installation 10 | 11 | mkdir -p "$HOME/Library/LaunchAgents/" 12 | 13 | cd "$HOME/Library/LaunchAgents/" 14 | 15 | curl --remote-name https://raw.githubusercontent.com/tjluoma/di/master/launchd/com.tjluoma.di-all.plist 16 | 17 | launchctl load $PWD/com.tjluoma.di-all.plist 18 | 19 | -------------------------------------------------------------------------------- /launchd/old/com.tjluoma.di-all.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | com.tjluoma.di-all 7 | Program 8 | /usr/local/bin/di-all.sh 9 | RunAtLoad 10 | 11 | StartInterval 12 | 14400 13 | 14 | 15 | --------------------------------------------------------------------------------