Location: PHPKode > projects > SCOP Heartbeat Administration interface > scop-2.0/html/scop/config/userrestore.php

<?
include ("../inc/header.inc");
include ("../inc/functions.inc");

$orig="/etc/scop/userbkup/ldirectord.cf";
$dest="/etc/ha.d/conf/ldirectord.cf";

if ( copy($orig,$dest) ) {
	//echo "<h2>The Virtual & Real Server settings have now been restored....</h2>";
} else {
	draw_error ("An error occured while trying to restore the backup...");
}

$orig="/etc/scop/userbkup/interfaces";
$dest="/etc/network/interfaces";

if ( copy($orig,$dest) ) {
	//echo "<h2>The Network informtion has now been restored....</h2>";
} else {
	draw_error ("An error occured while trying to restore the backup...");
}


$orig="/etc/scop/userbkup/haresources";
$dest="/etc/ha.d/haresources";

if ( copy($orig,$dest) ) {
	//echo "<h2>The Virtual IP address has now been restored....</h2>";
} else {
	draw_error ("An error occured while trying to restore the backup...");
}

//byLeal
//Desabilitado temporariamente a recuperacao do arquivo de firewall
// $orig="/etc/scop/userbkup/rc.firewall";
// $dest="/etc/rc.d/rc.firewall";

// if ( copy($orig,$dest) ) {
// 	//echo "<h2>The Firewall script has now been restored....</h2>";
// } else {
// 	draw_error ("An error occured while trying to restore the backup...");
// }


//Apenas se existirem...
$orig="/etc/scop/userbkup/haproxy.cfg";
$dest="/etc/haproxy/haproxy.cfg";

exec ("sudo chmod 777 $dest");
exec ("sudo chmod 777 $orig");

exec ("sudo cp $orig $dest");

$orig="/etc/scop/userbkup/pound.cfg";
$dest="/usr/local/etc/pound.cfg";

exec ("sudo chmod 777 $dest");
exec ("sudo chmod 777 $orig");

exec ("sudo cp $orig $dest");


$trans="104";
$a104 = "${$l.$trans}";
	echo "<center>$a104</center>";
SCOP_log("Config : User restore of all settings performed.");
include ("../inc/footer.inc");

?>


Return current item: SCOP Heartbeat Administration interface