Added check_datechaprilorg_update (#3591)
This commit is contained in:
parent
2db36d63bd
commit
a540df01ef
33
tools/check_datechaprilorg_update
Executable file
33
tools/check_datechaprilorg_update
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Nagios plugin to check paste version
|
||||||
|
#
|
||||||
|
# Author : Didier Clermonté <dclermonte@april.com>
|
||||||
|
# Author : Christian Momon<cmomon@april.com>
|
||||||
|
# Date : 7 Dec 2019
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function usage() {
|
||||||
|
echo "Usage : $0"
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
if [ "$#" -ne 0 ]; then
|
||||||
|
usage
|
||||||
|
else
|
||||||
|
lastVersion=$(curl -s https://framagit.org/api/v4/projects/16/releases | jshon -a -e name|cut -d '"' -f2|grep -v '[\^\(alpha\)]'|head -n 1)
|
||||||
|
currentVersion=$(cd /var/www/date.chapril.org && git branch | grep '*'|cut -c 11-100 )
|
||||||
|
|
||||||
|
#echo $currentVersion
|
||||||
|
#echo $lastVersion
|
||||||
|
if [ $currentVersion = $lastVersion ]; then
|
||||||
|
echo "OK"
|
||||||
|
result=0
|
||||||
|
else
|
||||||
|
echo "WARNING : new version available, current is $currentVersion, last is $lastVersion."
|
||||||
|
result=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
exit $result
|
Loading…
Reference in New Issue
Block a user