Files
neighborhoodwatch/run.d/toolkit.php
2013-10-15 19:57:09 +00:00

27 lines
533 B
PHP

<?php
// Generic tasks to read shell/environment settings into PHP
//
// Environment CHK_HOSTS holds hosts to check, get them in an array
//
if( getenv('CHK_HOSTS') == null ) {
$hosts = null;
}else {
$hosts = explode(' ', getenv('CHK_HOSTS'));
if (implode($hosts)=='') die("No hosts to check.\n");
}
// Verbosity settings
//
if( getenv('VERBOSE') == null ) {
$verbose = 0;
} else {
$verbose = getenv('VERBOSE');
}
function verbose($msg, $loglevel=0) {
global $verbose;
if($loglevel <= $verbose) echo $msg."\n";
}
?>