From 665ef04603f8b9f1b1b222f907e2c35207e25339 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 28 Apr 2005 00:03:10 +0000 Subject: Cleanup Disable/Enable Carp button to left. Requested-by: hoba --- packages/carp_status.php | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) (limited to 'packages/carp_status.php') diff --git a/packages/carp_status.php b/packages/carp_status.php index f6f085b6..2bcb7efa 100644 --- a/packages/carp_status.php +++ b/packages/carp_status.php @@ -35,20 +35,10 @@ function gentitle_pkg($pgname) { return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname; } -/* grab the current status of carp */ -$status = `/sbin/sysctl net.inet.carp.allow`; -$status = str_replace("\n","",$status); -$status = str_replace(" ","",$status); -$status = split(":", $status); - -$carp_counter=0; +$status = get_carp_status(); if($_POST['disablecarp'] <> "") { - $status = `/sbin/sysctl net.inet.carp.allow`; - $status = str_replace("\n","",$status); - $status = str_replace(" ","",$status); - $status = split(":", $status); - if($status[1] == "1") { - $savemsg = "{$carp_counter} items have been disabled."; + if($status == true) { + $savemsg = "{$carp_counter} ip's have been disabled."; $carp_counter=find_number_of_created_carp_interfaces(); for($x=0; $x<$carp_counter; $x++) mwexec("/sbin/ifconfig carp{$x} delete"); @@ -60,11 +50,7 @@ if($_POST['disablecarp'] <> "") { } } -/* grab the current status of carp */ -$status = `/sbin/sysctl net.inet.carp.allow`; -$status = str_replace("\n","",$status); -$status = str_replace(" ","",$status); -$status = split(":", $status); +$status = get_carp_status(); ?> @@ -93,17 +79,17 @@ include("fbegin.inc"); - -
"; + if($status == false) { + echo ""; } else { - echo "
"; + echo ""; } ?> - - + +

+ +

-- cgit v1.2.3
Carp Interface