Subversion-Projekte lars-tiefland.openvz_admin

Revision

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

Revision 72 Revision 76
Zeile 1... Zeile 1...
1
<?php
1
<?php
2
	//$Id: vServer.class.php 72 2007-10-27 20:08:34Z lars $
2
	//$Id: vServer.class.php 76 2008-01-24 19:58:21Z lars $
3
	class vServer
3
	class vServer
4
	{
4
	{
5
	 	protected $status;
5
	 	protected $status;
6
	 	protected $name;
6
	 	protected $name;
7
	 	protected $hn_id;
7
	 	protected $hn_id;
Zeile 162... Zeile 162...
162
			$sql="INSERT into vservers (v_id, hn_id, v_name, v_dist) VALUES ($this->v_id, $this->hn_id, '$this->name', $this->dist_id)";
162
			$sql="INSERT into vservers (v_id, hn_id, v_name, v_dist) VALUES ($this->v_id, $this->hn_id, '$this->name', $this->dist_id)";
163
			$res=$db->query($sql);
163
			$res=$db->query($sql);
164
			if(!PEAR::isError($res))
164
			if(!PEAR::isError($res))
165
			{
165
			{
166
				$v_id=$res->insert_id;
166
				$v_id=$res->insert_id;
167
				$sql="UPDATE ips SET used=1 WHERE ip=".$ip["ip"];
167
				$sql="UPDATE ips SET used=1 WHERE ip='".$ip["ip"]."'";
168
				$res=$db->query($sql);
168
				$res=$db->query($sql);
169
				if(!PEAR::isError($res))
169
				if(!PEAR::isError($res))
170
				{
170
				{
-
 
171
					$ip_id=$db->lastinsertid();
171
					$sql="INSERT INTO host_2_ip (ve_id, ip) VALUES ($v_id,".$ip["ip"].")";
172
					$sql="INSERT INTO host_2_ip (ve_id, ip) VALUES ($this->v_id,'".$ip_id."')";
172
					$res=$db->query($sql);
173
					$res=$db->query($sql);
173
					if(!PEAR::isError($res))
174
					if(!PEAR::isError($res))
174
					{
175
					{
175
						$cmd="ssh root@mainframe vzctl create $this->v_id --hostname $v_name --ostemplate $d_template --config vps.$d_name --ipadd ".$ip["ip"];
176
						$cmd="ssh root@mainframe vzctl create $this->v_id --hostname $v_name --ostemplate $d_template --config vps.$d_name --ipadd ".$ip["ip"];
176
						exec($cmd,$out,$ret);
177
						exec($cmd,$out,$ret);