summaryrefslogtreecommitdiff
path: root/roles/mox/templates/update_mox
blob: 9300b6871bdc43916ea2dbfe9c64575c7fe871f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/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