#!/bin/sh mox_url="https://beta.gobuilds.org/github.com/mjl-/mox@latest/linux-{{ mox_platform }}-latest" current_version="$(mox version | grep -Eo ^v[0-9.]\+)" latest_version="$(curl ${mox_url}/ --show-headers --silent | grep ^location: | grep -Eo /mox@v[0-9.]\+/ | grep -Eo v[0-9.]\+)" if [ -z "$current_version" ] || [ "$current_version" != "$latest_version" ] then wget -O ~/mox ${mox_url}/dl chmod 755 ~/mox rc-service mox stop mv ~/mox /usr/bin/mox rc-service mox restart fi