diff --git a/discovery.php b/discovery.php index 9dc39f4fe..3006399ff 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 0027748ee..84e95af1d 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 26f90c505..6412c37be 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::');