From 86059f67c126f4d552e8750ea25bb04178aa93a3 Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 25 Aug 2015 08:40:20 +0000 Subject: [PATCH] updated to use function for last commit --- discovery.php | 2 +- includes/functions.php | 4 ++++ poller.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/discovery.php b/discovery.php index 9dc39f4fe2..3006399ffc 100755 --- a/discovery.php +++ b/discovery.php @@ -27,7 +27,7 @@ $options = getopt('h:m:i:n:d::a::q'); if (!isset($options['q'])) { echo $config['project_name_version']." Discovery\n"; - echo `git log -n 1|grep 'commit '`."\n"; + echo get_last_commit()."\n"; } if (isset($options['h'])) { diff --git a/includes/functions.php b/includes/functions.php index 0027748eec..84e95af1dd 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1227,3 +1227,7 @@ function fping($host,$params) { function function_check($function) { return function_exists($function); } + +function get_last_commit() { + return `git log -n 1|head -n1`; +}//end get_last_commit diff --git a/poller.php b/poller.php index 26f90c505c..6412c37be9 100755 --- a/poller.php +++ b/poller.php @@ -23,7 +23,7 @@ require 'includes/alerts.inc.php'; $poller_start = utime(); echo $config['project_name_version']." Poller\n"; -echo `git log -n 1|grep 'commit '`."\n"; +echo get_last_commit()."\n"; $options = getopt('h:m:i:n:r::d::a::');