aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU-AD\carlsoan <carlsoan@gophersjos7275.ad.uc.edu>2018-06-13 09:46:33 -0400
committerU-AD\carlsoan <carlsoan@gophersjos7275.ad.uc.edu>2018-06-13 09:46:33 -0400
commit7df84c5725b9ca223bf7c230e5c5ce3483686f75 (patch)
tree1967ac8763c21a5a3641237e7b3dffcd4e8b23d0
parent8f2dd9380368b3c8c7cca0bf96669165c8f95fc0 (diff)
updated checks to verify version numerically
-rwxr-xr-xchecks/gheversion.sh.m42
-rwxr-xr-xchecks/httpdversion.sh.m42
-rwxr-xr-xchecks/kernversion.sh.m42
-rwxr-xr-xchecks/monitversion.sh.m42
-rwxr-xr-xchecks/php7check.sh.m42
-rwxr-xr-xchecks/snmpversion.sh.m42
-rwxr-xr-xchecks/sshversion.sh.m42
-rwxr-xr-xchecks/sslversion.sh.m42
-rwxr-xr-xchecks/tcversion.sh.m42
9 files changed, 9 insertions, 9 deletions
diff --git a/checks/gheversion.sh.m4 b/checks/gheversion.sh.m4
index 32cdb5a..4cb7605 100755
--- a/checks/gheversion.sh.m4
+++ b/checks/gheversion.sh.m4
@@ -28,7 +28,7 @@ else
else
gheversiondata > /tmp/gheversion
diff /tmp/gheversion $CONFDIR/gheversion > /dev/null
- if [ $? -eq 1 ] && [ $(grep '^[ \t]*$' /tmp/gheversion | wc -l) -eq 0 ]; then
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/gheversion | wc -l) -eq 1 ]; then
mv /tmp/gheversion $CONFDIR/gheversion
echo "{\"value1\":\"$(cat $CONFDIR/gheversion)\"}" | curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{gheversion}/with/key/$IFTTTKEY
else
diff --git a/checks/httpdversion.sh.m4 b/checks/httpdversion.sh.m4
index 93ba2f4..ed68d8f 100755
--- a/checks/httpdversion.sh.m4
+++ b/checks/httpdversion.sh.m4
@@ -25,7 +25,7 @@ else
else
httpdversiondata > /tmp/httpdversion
diff /tmp/httpdversion $CONFDIR/httpdversion
- if [ $? -eq 1 ] && [ $(grep '^[ \t]*$' /tmp/httpdversion | wc -l) -eq 0 ]; then
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/httpdversion | wc -l) -eq 1 ]; then
mv /tmp/httpdversion $CONFDIR/httpdversion
echo "{\"value1\":\"$(cat $CONFDIR/httpdversion)\"}" |curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{httpdversion}/with/key/$IFTTTKEY
else
diff --git a/checks/kernversion.sh.m4 b/checks/kernversion.sh.m4
index 22d414c..98a2908 100755
--- a/checks/kernversion.sh.m4
+++ b/checks/kernversion.sh.m4
@@ -25,7 +25,7 @@ else
else
kernversiondata > /tmp/kernversion
diff /tmp/kernversion $CONFDIR/kernversion > /dev/null
- if [ $? -eq 1 ] && [ $(grep '^[ \t]*$' /tmp/kernversion | wc -l) -eq 0 ]; then
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/kernversion | wc -l) -eq 1 ]; then
mv /tmp/kernversion $CONFDIR/kernversion
echo "{\"value1\":\"$(cat $CONFDIR/kernversion)\"}" | curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{kernversion}/with/key/$IFTTTKEY
else
diff --git a/checks/monitversion.sh.m4 b/checks/monitversion.sh.m4
index 79cec09..83d4ea0 100755
--- a/checks/monitversion.sh.m4
+++ b/checks/monitversion.sh.m4
@@ -25,7 +25,7 @@ else
else
monitversiondata > /tmp/monitversion
diff /tmp/monitversion $CONFDIR/monitversion
- if [ $? -eq 1 ] && [ $(grep '^[ \t]*$' /tmp/monitversion | wc -l) -eq 0 ]; then
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/monitversion | wc -l) -eq 1 ]; then
mv /tmp/monitversion $CONFDIR/monitversion
echo "{\"value1\":\"$(cat $CONFDIR/monitversion)\"}" |curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{monitversion}/with/key/$IFTTTKEY
else
diff --git a/checks/php7check.sh.m4 b/checks/php7check.sh.m4
index 2992e1c..e27019b 100755
--- a/checks/php7check.sh.m4
+++ b/checks/php7check.sh.m4
@@ -25,7 +25,7 @@ else
else
php7versiondata > /tmp/php7ver
diff /tmp/php7ver $CONFDIR/php7ver
- if [ $? -eq 1 ] && [ $(grep '^[ \t]*$' /tmp/php7ver | wc -l) -eq 0 ]; then
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/php7ver | wc -l) -eq 1 ]; then
mv /tmp/php7ver $CONFDIR/php7ver
echo "{\"value1\":\"$(cat $CONFDIR/php7ver)\"}" |curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{php7version}/with/key/$IFTTTKEY
else
diff --git a/checks/snmpversion.sh.m4 b/checks/snmpversion.sh.m4
index 495b0c9..637a637 100755
--- a/checks/snmpversion.sh.m4
+++ b/checks/snmpversion.sh.m4
@@ -25,7 +25,7 @@ else
else
snmpversiondata > /tmp/snmpver
diff /tmp/snmpver $CONFDIR/snmpver
- if [ $? -eq 1 ]; then
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/snmpver | wc -l) -eq 1 ]; then
mv /tmp/snmpver $CONFDIR/snmpver
echo "{\"value1\":\"$(cat $CONFDIR/snmpver)\"}" |curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{snmpversion}/with/key/$IFTTTKEY
else
diff --git a/checks/sshversion.sh.m4 b/checks/sshversion.sh.m4
index f496f1c..158bac0 100755
--- a/checks/sshversion.sh.m4
+++ b/checks/sshversion.sh.m4
@@ -25,7 +25,7 @@ else
else
sshversiondata > /tmp/sshver
diff /tmp/sshver $CONFDIR/sshver
- if [ $? -eq 1 ]; then
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/sshver | wc -l) -eq 1 ]; then
mv /tmp/sshver $CONFDIR/sshver
echo "{\"value1\":\"$(cat $CONFDIR/sshver)\"}" |curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{sshversion}/with/key/$IFTTTKEY
else
diff --git a/checks/sslversion.sh.m4 b/checks/sslversion.sh.m4
index a6d4b1e..3b5aac2 100755
--- a/checks/sslversion.sh.m4
+++ b/checks/sslversion.sh.m4
@@ -25,7 +25,7 @@ else
else
opensslversiondata > /tmp/sslver
diff /tmp/sslver $CONFDIR/sslver
- if [ $? -eq 1 ]; then
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/sslver | wc -l) -eq 1 ]; then
mv /tmp/sslver $CONFDIR/sslver
echo "{\"value1\":\"$(cat $CONFDIR/sslver)\"}" |curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{sslversion}/with/key/$IFTTTKEY
else
diff --git a/checks/tcversion.sh.m4 b/checks/tcversion.sh.m4
index bd202f8..5626eef 100755
--- a/checks/tcversion.sh.m4
+++ b/checks/tcversion.sh.m4
@@ -25,7 +25,7 @@ else
else
tinycoreversiondata > /tmp/tcver
diff /tmp/tcver $CONFDIR/tcver > /dev/null
- if [ $? -eq 1 ]; then
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/tcver | wc -l) -eq 1 ]; then
mv /tmp/tcver $CONFDIR/tcver
echo "{\"value1\":\"$(cat $CONFDIR/tcver)\"}" | curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{tcversion}/with/key/$IFTTTKEY
else