Files
HomeServerCTs/CT-Files/linkwarden/Scripts/Update-monolith.sh

13 lines
644 B
Bash

#!/bin/bash
CurmonolithVersion=$(curl -s https://api.github.com/repos/Y2Z/monolith/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : )
if test "$CurmonolithVersion" = "$(cat /opt/monolith-Version)" ; then
echo 'Monolith up-to-date'
exit
else
echo 'Updating Monolith'
mv /opt/monolith-gnu-linux-x86_64 /opt/monolith-gnu-linux-x86_64.old
curl -L -o /opt/monolith-gnu-linux-x86_64 https://github.com/Y2Z/monolith/releases/download/"$CurmonolithVersion"/monolith-gnu-linux-x86_64
chmod +x /opt/monolith-gnu-linux-x86_64
echo "$CurmonolithVersion" > /opt/monolith-Version
fi