5 $WEB_ROOT_FS = realpath(dirname(__FILE__));
6 $BASE_URL = dirname($_SERVER["PHP_SELF"]);
8 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
10 // add libglcas as if it were a path in ../libglcas
11 if(file_exists("../libglcas")) {
12 $path = realpath($WEB_ROOT_FS."/../");
13 error_log("added glcas path as $path");
14 set_include_path(get_include_path().PATH_SEPARATOR.$path);
17 // include the based library
18 require_once("libglcas/lib.php");
26 // TODO: do this better
27 $configpath = glcas_getWebConfigPath();
28 $glconfig = new GLCASConfig();
29 $glconfig->loadConfig($configpath);
36 echo "Need at least one ip address\n";
39 for($i=1; $i < $argc; $i++) {
40 echo "pinging ".$argv[$i]."\n";
42 $res = exec("/bin/ping -c 1 $ip 2>&1", $arr, $returned);
45 $glconfig->delData("ping", "$ip");
46 $glconfig->addData("ping", "$ip", time(), "failed");
48 $res_v = preg_split("/[\/ ]+/",$res);
51 $glconfig->delData("ping", "$ip");
52 $glconfig->addData("ping", "$ip", time(), $rettime);