Skip to content
Snippets Groups Projects
Commit 168c514d authored by Florian Schaal's avatar Florian Schaal
Browse files

when changing the ip_address for a vm set the old ip to "unused"

parent 93177377
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,10 @@ class vm_openvz_plugin {
}
// Set the IP address
if(isset($this->dataRecord['ip_address'])) $app->db->query("UPDATE openvz_ip SET vm_id = ? WHERE ip_address = ?", $this->id, $this->dataRecord['ip_address']);
if(isset($this->dataRecord['ip_address'])) {
$app->db->query("UPDATE openvz_ip SET vm_id = 0 WHERE vm_id = ?", $this->id);
$app->db->query("UPDATE openvz_ip SET vm_id = ? WHERE ip_address = ?", $this->id, $this->dataRecord['ip_address']);
}
// Create the OpenVZ config file and store it in config field
$this->makeOpenVZConfig();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment