Subversion-Projekte lars-tiefland.openvz_admin

Revision

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

Revision 138 Revision 151
Zeile 1... Zeile 1...
1
<?php
1
<?php
2
	//$Id: load.php 138 2008-07-15 11:26:24Z lars $
2
	//$Id: load.php 151 2009-05-25 10:02:48Z 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 18... Zeile 18...
18
	}
18
	}
Zeile 19... Zeile 19...
19
 
19
 
20
	function load_configs($hn_id, $hn_name)
20
	function load_configs($hn_id, $hn_name)
21
	{
21
	{
22
		unset($out);
22
		unset($out);
23
		$cmd = "ssh root@$hn_name ls /etc/vz/conf/*.conf";
23
		$cmd = "ping $hn_name -w1";
-
 
24
		exec($cmd, $out, $ret);
-
 
25
		if(!$ret)
-
 
26
		{
-
 
27
			echo "Hole Konfigurationen von $hn_name\n";
-
 
28
			unset( $out );
-
 
29
			$cmd = "ssh root@$hn_name ls /etc/vz/conf/*.conf";
24
		exec($cmd, $out, $ret);
30
			exec($cmd, $out, $ret);
-
 
31
			return $out;
25
		return $out;
32
		}
Zeile 26... Zeile 33...
26
	}
33
	}
27
 
34
 
28
	function read_config($hn_id, $hn_name, $config)
35
	function read_config($hn_id, $hn_name, $config)
Zeile 59... Zeile 66...
59
 
66
 
60
		foreach ($cfgs as $config)
67
		foreach ($cfgs as $config)
61
		{
68
		{
62
			if (isset($config["DISTRIBUTION"]))
69
			if (isset($config["DISTRIBUTION"]))
-
 
70
			{
-
 
71
				$dist_name=$config["DISTRIBUTION"];
-
 
72
			}
-
 
73
			else
-
 
74
			{
-
 
75
				$dist_name="centos";
63
			{
76
			}
64
				$sql = "SELECT * FROM distributions WHERE dist_name='" . $config["DISTRIBUTION"] .
77
				$sql = "SELECT * FROM distributions WHERE dist_name='" . $config["DISTRIBUTION"] .
65
					"'";
78
					"'";
66
				$res = $db->query($sql);
79
				$res = $db->query($sql);
67
				if (!PEAR::isError($res))
80
				if (!PEAR::isError($res))
Zeile 98... Zeile 111...
98
				}
111
				}
99
				else
112
				else
100
				{
113
				{
101
					die($res->getUserInfo());
114
					die($res->getUserInfo());
102
				}
115
				}
103
			}
-
 
104
			$sql = "SELECT * FROM vservers WHERE v_id=" . $config["v_id"] . " AND hn_id=$hn_id";
116
			$sql = "SELECT * FROM vservers WHERE v_id=" . $config["v_id"] . " AND hn_id=$hn_id";
105
			$res = $db->query($sql);
117
			$res = $db->query($sql);
106
			if (!PEAR::isError($res))
118
			if (!PEAR::isError($res))
107
			{
119
			{
108
				if (!$res->numRows())
120
				if (!$res->numRows())