13 lines
667 B
Bash
13 lines
667 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 ' echo 'Updating Monolith'.sh 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 |