ajout du check
This commit is contained in:
parent
3c77e954e9
commit
7b172fccd0
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
get_latest_release() {
|
||||
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
|
||||
grep '"tag_name":' | # Get tag line
|
||||
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
|
||||
}
|
||||
|
||||
## last release
|
||||
a=$(get_latest_release "ether/etherpad-lite")
|
||||
## installed release
|
||||
b=$(cat /var/www/etherpad-lite/CHANGELOG.md | grep '#' | head -n 1 | tr -d '# ' )
|
||||
|
||||
|
||||
if [ $a == $b ]
|
||||
then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "WARNING : new version available, installed is $b, last is $a."
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue