aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Carlson <ace@debian-eeepc>2018-06-18 15:57:06 -0400
committerAndy Carlson <ace@debian-eeepc>2018-06-18 15:57:06 -0400
commit8ec9539eafb846f7d241a1ba537ca36b31738de1 (patch)
tree2cda9abaa685ea3786eeb9c2f75d25b4865498b5
parent879bbfaf314e335502e773b889932fdcdae7d34d (diff)
fixed php5 cr
-rw-r--r--[-rwxr-xr-x]checks/php5check.sh.m470
1 files changed, 35 insertions, 35 deletions
diff --git a/checks/php5check.sh.m4 b/checks/php5check.sh.m4
index 65339a8..4f4c574 100755..100644
--- a/checks/php5check.sh.m4
+++ b/checks/php5check.sh.m4
@@ -1,35 +1,35 @@
-#!/bin/bash
-
-##############################
-# sends the follows JSON to webhook:
-#
-# { "value1":"<php5-version>" }
-##############################
-
-CHECKDIR="BASEDIR"
-CONFDIR="$CHECKDIR/conf"
-
-IFTTTKEY="KEYTEXT"
-
-php5versiondata() {
- curl -s http://php.net/downloads.php 2>/dev/null | \
- grep -A1 'Current Stable' | awk '/^[ \t]*PHP 5/ { print $2 }'
-}
-
-if [ "$1" == "cache" ]; then
- php5versiondata > $CONFDIR/php5ver
-else
- if [ ! -f $CONFDIR/php5ver ]; then
- echo "Caching PHP 5 version"
- $0 cache
- else
- php5versiondata > /tmp/php5ver
- diff /tmp/php5ver $CONFDIR/php5ver
- if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/php5ver | wc -l) -eq 1 ]; then
- mv /tmp/php5ver $CONFDIR/php5ver
- echo "{\"value1\":\"$(cat $CONFDIR/php5ver)\"}" |curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{php5version}/with/key/$IFTTTKEY
- else
- echo "skipping"
- fi
- fi
-fi
+#!/bin/bash
+
+##############################
+# sends the follows JSON to webhook:
+#
+# { "value1":"<php5-version>" }
+##############################
+
+CHECKDIR="BASEDIR"
+CONFDIR="$CHECKDIR/conf"
+
+IFTTTKEY="KEYTEXT"
+
+php5versiondata() {
+ curl -s http://php.net/downloads.php 2>/dev/null | \
+ grep -A1 'Current Stable' | awk '/^[ \t]*PHP 5/ { print $2 }'
+}
+
+if [ "$1" == "cache" ]; then
+ php5versiondata > $CONFDIR/php5ver
+else
+ if [ ! -f $CONFDIR/php5ver ]; then
+ echo "Caching PHP 5 version"
+ $0 cache
+ else
+ php5versiondata > /tmp/php5ver
+ diff /tmp/php5ver $CONFDIR/php5ver
+ if [ $? -eq 1 ] && [ $(grep '^[0-9\.]\+$' /tmp/php5ver | wc -l) -eq 1 ]; then
+ mv /tmp/php5ver $CONFDIR/php5ver
+ echo "{\"value1\":\"$(cat $CONFDIR/php5ver)\"}" |curl -X POST -d ''"$(cat -)"'' -H "Content-type: application/json" https://maker.ifttt.com/trigger/{php5version}/with/key/$IFTTTKEY
+ else
+ echo "skipping"
+ fi
+ fi
+fi