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

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

$orig="/etc/scop/bkup/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/bkup/rc.inet1.conf";
$dest="/etc/rc.d/rc.inet1.conf";

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

$orig="/etc/scop/bkup/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...");
}

$orig="/etc/scop/bkup/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...");
}

$orig="/etc/scop/bkup/passwords";
$dest="/etc/scop/passwords";
exec ("sudo chmod 777 $dest ");
if ( copy($orig,$dest) ) {
	//echo "<h2>The Password file has now been restored....</h2>";
} else {
	draw_error ("An error occured while trying to restore the backup...");
}

$orig="/etc/scop/bkup/groups";
$dest="/etc/scop/groups";
exec ("sudo chmod 777 $dest ");
if ( copy($orig,$dest) ) {
	//echo "<h2>The Groups file has now been restored....</h2>";
} else {
	draw_error ("An error occured while trying to restore the backup...");
}

			$orig="/etc/scop/bkup/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/bkup/pound.cfg";
			$dest="/usr/local/etc/pound.cfg";

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

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


echo "<p><center>All settings restored from manufacturer backup.</center></p>";
SCOP_log("Config : All settings restored from manufacturer backup.");


include ("../inc/footer.inc");

?>


Return current item: SCOP Heartbeat Administration interface