3 require_once('setup_plconf.php');
5 /* Look for config file */
7 $config_directory= "/var/www/html/PlanetLabConf/ntp/";
8 $file_prefix= "ntp.conf.";
9 $hostname_bits = explode('.', $hostname);
10 $chunk_counter = sizeof ($hostname_bits);
11 $compare_chunk = $hostname ;
13 $default_name = "default";
15 /* look for the host specific overrides */
16 $file_name = $config_directory . "host/". $file_prefix . $compare_chunk ;
17 if (is_file($file_name)) {
22 /* look for the domain specific overrides */
23 while ($chunk_counter > 0) {
24 $file_name = $config_directory . $file_prefix . $compare_chunk ;
25 if (is_file($file_name)) {
30 array_shift($hostname_bits);
31 $compare_chunk = implode('.',$hostname_bits);
36 if ($found_file and is_readable($file_name)) {
37 $lines=file($file_name);
40 $file_name = $config_directory . $file_prefix . $default_name ;
41 $lines=file($file_name);
44 foreach ($lines as $line_num => $line) {
46 $elements=explode(' ',$line);
47 if ($elements[0] == "server") {
48 print ("$elements[1]\n");