catchup with lots of updates
[buildscripts] / navidrome
diff --git a/navidrome b/navidrome
new file mode 100755 (executable)
index 0000000..16425d0
--- /dev/null
+++ b/navidrome
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# example https://github.com/navidrome/navidrome/releases/download/v0.48.0/navidrome_0.48.0_Linux_x86_64.tar.gz
+up=$(wget -q -O- https://api.github.com/repos/navidrome/navidrome/releases/latest | jq -r .assets[].browser_download_url | grep Linux_x86_64)
+
+re='[[:space:]]'
+if [[ ! $up || $up == $re ]]; then
+  echo "failed to get good update url. got: $up"
+fi
+uptar=${up##*/}
+if [[ ! -e /a/opt/$uptar ]]; then
+  # kill off old version
+  rm -rf /a/opt/navidrome_*
+  wget -P /a/opt $up
+  # extracts to single binary
+  tar -C /a/opt -zxf /a/opt/$uptar
+fi