Subversion-Projekte lars-tiefland.openvz_admin

Revision

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

Revision 119 Revision 120
Zeile 1... Zeile 1...
1
<?php
1
<?php
2
	//$Id: load.php 119 2008-05-22 13:42:05Z lars $
2
	//$Id: load.php 120 2008-05-22 13:42:30Z 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 11... Zeile 11...
11
	foreach ($hns as $hn_id => $hn_name)
11
	foreach ($hns as $hn_id => $hn_name)
12
	{
12
	{
13
		$configs=load_configs($hn_id,$hn_name);
13
		$configs=load_configs($hn_id,$hn_name);
14
		foreach($configs as $conf_id => $config)
14
		foreach($configs as $conf_id => $config)
15
		{
15
		{
16
			$cfg=read_config($hn_name,$config);
16
			$cfg=read_config($hn_id, $hn_name,$config);
17
			var_dump($cfg);
17
			var_dump($cfg);
18
		}
18
		}
19
	}
19
	}
Zeile 20... Zeile 20...
20
	
20
	
Zeile 24... Zeile 24...
24
		$cmd = "ssh root@$hn_name ls /etc/vz/conf/*.conf";
24
		$cmd = "ssh root@$hn_name ls /etc/vz/conf/*.conf";
25
		exec($cmd, $out, $ret);
25
		exec($cmd, $out, $ret);
26
		return $out;
26
		return $out;
27
	}
27
	}
Zeile 28... Zeile 28...
28
	
28
	
29
	function read_config($hn_name, $conf)
29
	function read_config($hn_id, $hn_name, $conf)
30
	{
30
	{
31
			$cmd = "scp root@$hn_name:/etc/vz/conf/$conf cfgs/$hn_id";
31
			$cmd = "scp root@$hn_name:/etc/vz/conf/$conf cfgs/$hn_id";
32
			exec($cmd, $out, $ret);
32
			exec($cmd, $out, $ret);
33
			$cont = file("cfgs/$hn_id/$conf");
33
			$cont = file("cfgs/$hn_id/$conf");