Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 126 | Revision 128 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 126 Revision 127
Zeile 1... Zeile 1...
1
<?php
1
<?php
2
	//$Id: load.php 126 2008-05-22 15:12:58Z lars $
2
	//$Id: load.php 127 2008-05-22 15:21:43Z lars $
3
	/**
3
	/**
4
	 * 	@package	openvz_admin
4
	 * 	@package	openvz_admin
5
	 * 	@author		Lars Tiefland <ltiefland@gmail.com> 
5
	 * 	@author		Lars Tiefland <ltiefland@gmail.com> 
6
	 **/
6
	 **/
7
	require ("include/common.php");
7
	require ("include/common.php");
Zeile 31... Zeile 31...
31
		$conf = basename($config);
31
		$conf = basename($config);
32
		$cmd = "scp root@$hn_name:/etc/vz/conf/$conf cfgs/$hn_id";
32
		$cmd = "scp root@$hn_name:/etc/vz/conf/$conf cfgs/$hn_id";
33
		exec($cmd, $out, $ret);
33
		exec($cmd, $out, $ret);
34
		$cont = file("cfgs/$hn_id/$conf");
34
		$cont = file("cfgs/$hn_id/$conf");
35
		$cont[] = "v_id=\"" . substr($conf, 0, strpos($conf, '.')) . "\"";
35
		$cont[] = "v_id=\"" . substr($conf, 0, strpos($conf, '.')) . "\"";
-
 
36
		foreach ($conf as $value)
-
 
37
		{
-
 
38
			if ($value)
-
 
39
			{
-
 
40
				$value = rtrim($value);
-
 
41
				if ($value[0] == " " || $value[0] == "#")
-
 
42
				{
-
 
43
					continue;
-
 
44
				}
-
 
45
				$cfg_v = explode("=", $value);
-
 
46
				$cfg_val[$cfg_v[0]] = trim($cfg_v[1], '"');
-
 
47
			}
-
 
48
			else
-
 
49
			{
-
 
50
				continue;
-
 
51
			}
-
 
52
			$cfgs[] = $cfg_val;
-
 
53
		}
36
		return $cont;
54
		return $cfgs;
37
	}
55
	}
Zeile 38... Zeile 56...
38
 
56
 
39
	function update_db($hn_id, $cfgs)
57
	function update_db($hn_id, $cfgs)
40
	{
58
	{
Zeile 114... Zeile 132...
114
				}
132
				}
115
			}
133
			}
116
		}
134
		}
117
	}
135
	}
118
?>
136
?>
-
 
137
  
119
138