#!/bin/bash alias download="./padown" _seed='https://repos.wine-staging.com/macosx/i686/' _url_latest="$_seed$(curl $_seed 2> /dev/null | \ grep 'pkg<' | \ tail -n1)" _ver_latest=$(echo $_url_latest | \ awk -F"wine-staging-" '{print $2}' | \ awk -F"-osx" '{print $1}') _ver_current=$(wine --version | \ awk -F"wine-" '{print $2}' | \ awk -F" " '{print $1}') echo "Latest version: $_ver_latest" echo "Current version: $_ver_current" [[ ! $_ver_latest == $_ver_current ]] && { download $_url_latest open wine-staging-$_ver_latest-osx.pkg } || \ echo "already latest."