aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy/haproxy_global.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-08-29 12:34:20 -0400
committerjim-p <jimp@pfsense.org>2013-08-29 12:34:20 -0400
commit4faa97a29e62d37ff7a75488c82e39cd909feb96 (patch)
tree8e4b75c4276375a76fd4a4c8779a57b8fcd65913 /config/haproxy/haproxy_global.php
parent6f8bef0a95e943f35144b342f12013638dde27e3 (diff)
downloadpfsense-packages-4faa97a29e62d37ff7a75488c82e39cd909feb96.tar.gz
pfsense-packages-4faa97a29e62d37ff7a75488c82e39cd909feb96.tar.bz2
pfsense-packages-4faa97a29e62d37ff7a75488c82e39cd909feb96.zip
Add a manual config validation option to HAproxy (using -c to only check config file)
Diffstat (limited to 'config/haproxy/haproxy_global.php')
-rwxr-xr-xconfig/haproxy/haproxy_global.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/config/haproxy/haproxy_global.php b/config/haproxy/haproxy_global.php
index c09b202f..aa046544 100755
--- a/config/haproxy/haproxy_global.php
+++ b/config/haproxy/haproxy_global.php
@@ -89,6 +89,12 @@ if ($_POST) {
touch($d_haproxyconfdirty_path);
write_config();
}
+
+ if ($_POST['Submit'] == "Save and Check Config") {
+ $check_output = haproxy_check_config();
+ if (empty($check_output))
+ $check_output = "No output.";
+ }
}
}
@@ -159,6 +165,14 @@ function enable_change(enable_change) {
<td>
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
+ <?php if ($_POST['Submit'] == "Save and Check Config"): ?>
+ <tr><td colspan="2" valign="top" class="vncell">
+Configuration check output:
+<pre>
+<?= $check_output; ?>
+</pre>
+ </td></tr>
+ <?php endif; ?>
<tr>
<td colspan="2" valign="top" class="listtopic">General settings</td>
</tr>
@@ -386,6 +400,7 @@ function enable_change(enable_change) {
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="Save" onClick="enable_change(true)">
+ <input name="Submit" type="submit" class="formbtn" value="Save and Check Config" onClick="enable_change(true)">
</td>
</td>
</tr>