system_advanced_misc.php 27.4 KB
Newer Older
Ad Schellevis's avatar
Ad Schellevis committed
1
<?php
2

Ad Schellevis's avatar
Ad Schellevis committed
3
/*
4
	Copyright (C) 2014-2015 Deciso B.V.
Ad Schellevis's avatar
Ad Schellevis committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
	Copyright (C) 2005-2007 Scott Ullrich
	Copyright (C) 2008 Shrew Soft Inc
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
	All rights reserved.

	Redistribution and use in source and binary forms, with or without
	modification, are permitted provided that the following conditions are met:

	1. Redistributions of source code must retain the above copyright notice,
	   this list of conditions and the following disclaimer.

	2. Redistributions in binary form must reproduce the above copyright
	   notice, this list of conditions and the following disclaimer in the
	   documentation and/or other materials provided with the distribution.

	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
	POSSIBILITY OF SUCH DAMAGE.
*/

32
require_once("guiconfig.inc");
Ad Schellevis's avatar
Ad Schellevis committed
33 34 35
require_once("filter.inc");
require_once("vpn.inc");
require_once("vslb.inc");
36
require_once("system.inc");
37
require_once("pfsense-utils.inc");
38
require_once("services.inc");
39
require_once("interfaces.inc");
Ad Schellevis's avatar
Ad Schellevis committed
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

$pconfig['proxyurl'] = $config['system']['proxyurl'];
$pconfig['proxyport'] = $config['system']['proxyport'];
$pconfig['proxyuser'] = $config['system']['proxyuser'];
$pconfig['proxypass'] = $config['system']['proxypass'];
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
$pconfig['srctrack'] = $config['system']['srctrack'];
$pconfig['gw_switch_default'] = isset($config['system']['gw_switch_default']);
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
$pconfig['crypto_hardware'] = $config['system']['crypto_hardware'];
$pconfig['thermal_hardware'] = $config['system']['thermal_hardware'];
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
$pconfig['kill_states'] = isset($config['system']['kill_states']);
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);

$pconfig['powerd_ac_mode'] = "hadp";
58 59 60
if (!empty($config['system']['powerd_ac_mode'])) {
    $pconfig['powerd_ac_mode'] = $config['system']['powerd_ac_mode'];
}
Ad Schellevis's avatar
Ad Schellevis committed
61 62

$pconfig['powerd_battery_mode'] = "hadp";
63 64 65
if (!empty($config['system']['powerd_battery_mode'])) {
    $pconfig['powerd_battery_mode'] = $config['system']['powerd_battery_mode'];
}
Ad Schellevis's avatar
Ad Schellevis committed
66 67

$crypto_modules = array('glxsb' => gettext("AMD Geode LX Security Block"),
68
            'aesni' => gettext("AES-NI CPU-based Acceleration"));
Ad Schellevis's avatar
Ad Schellevis committed
69

70 71
$thermal_hardware_modules = array(  'coretemp' => gettext("Intel Core* CPU on-die thermal sensor"),
                    'amdtemp' => gettext("AMD K8, K10 and K11 CPU on-die thermal sensor"));
Ad Schellevis's avatar
Ad Schellevis committed
72 73

if ($_POST) {
74 75
    unset($input_errors);
    $pconfig = $_POST;
Ad Schellevis's avatar
Ad Schellevis committed
76

77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
    ob_flush();
    flush();

    if (!empty($_POST['crypto_hardware']) && !array_key_exists($_POST['crypto_hardware'], $crypto_modules)) {
        $input_errors[] = gettext("Please select a valid Cryptographic Accelerator.");
    }

    if (!empty($_POST['thermal_hardware']) && !array_key_exists($_POST['thermal_hardware'], $thermal_hardware_modules)) {
        $input_errors[] = gettext("Please select a valid Thermal Hardware Sensor.");
    }

    if (!$input_errors) {
        if ($_POST['harddiskstandby'] <> "") {
            $config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
            system_set_harddisk_standby();
        } else {
            unset($config['system']['harddiskstandby']);
        }

        if ($_POST['proxyurl'] <> "") {
            $config['system']['proxyurl'] = $_POST['proxyurl'];
        } else {
            unset($config['system']['proxyurl']);
        }

        if ($_POST['proxyport'] <> "") {
            $config['system']['proxyport'] = $_POST['proxyport'];
        } else {
            unset($config['system']['proxyport']);
        }

        if ($_POST['proxyuser'] <> "") {
            $config['system']['proxyuser'] = $_POST['proxyuser'];
        } else {
            unset($config['system']['proxyuser']);
        }

        if ($_POST['proxypass'] <> "") {
            $config['system']['proxypass'] = $_POST['proxypass'];
        } else {
            unset($config['system']['proxypass']);
        }

        $need_relayd_restart = false;
        if ($_POST['lb_use_sticky'] == "yes") {
            if (!isset($config['system']['lb_use_sticky'])) {
                $config['system']['lb_use_sticky'] = true;
                $config['system']['srctrack'] = $_POST['srctrack'];
                $need_relayd_restart = true;
            }
        } else {
            if (isset($config['system']['lb_use_sticky'])) {
                unset($config['system']['lb_use_sticky']);
                $need_relayd_restart = true;
            }
        }

        if ($_POST['gw_switch_default'] == "yes") {
            $config['system']['gw_switch_default'] = true;
        } else {
            unset($config['system']['gw_switch_default']);
        }

        if ($_POST['powerd_enable'] == "yes") {
            $config['system']['powerd_enable'] = true;
        } else {
            unset($config['system']['powerd_enable']);
        }

        $config['system']['powerd_ac_mode'] = $_POST['powerd_ac_mode'];
        $config['system']['powerd_battery_mode'] = $_POST['powerd_battery_mode'];

        if ($_POST['crypto_hardware']) {
            $config['system']['crypto_hardware'] = $_POST['crypto_hardware'];
        } else {
            unset($config['system']['crypto_hardware']);
        }

        if ($_POST['thermal_hardware']) {
            $config['system']['thermal_hardware'] = $_POST['thermal_hardware'];
        } else {
            unset($config['system']['thermal_hardware']);
        }

        if ($_POST['schedule_states'] == "yes") {
            $config['system']['schedule_states'] = true;
        } else {
            unset($config['system']['schedule_states']);
        }

        if ($_POST['kill_states'] == "yes") {
            $config['system']['kill_states'] = true;
        } else {
            unset($config['system']['kill_states']);
        }

        if ($_POST['skip_rules_gw_down'] == "yes") {
            $config['system']['skip_rules_gw_down'] = true;
        } else {
            unset($config['system']['skip_rules_gw_down']);
        }

        if ($_POST['use_mfs_tmpvar'] == "yes") {
            $config['system']['use_mfs_tmpvar'] = true;
        } else {
            unset($config['system']['use_mfs_tmpvar']);
        }

        if (isset($_POST['rrdbackup'])) {
            $config['system']['rrdbackup'] = $_POST['rrdbackup'];
            install_cron_job("/usr/local/etc/rc.backup_rrd", ($config['system']['rrdbackup'] > 0), $minute = "0", "*/{$config['system']['rrdbackup']}");
        }
        if (isset($_POST['dhcpbackup'])) {
            $config['system']['dhcpbackup'] = $_POST['dhcpbackup'];
            install_cron_job("/usr/local/etc/rc.backup_dhcpleases", ($config['system']['dhcpbackup'] > 0), $minute = "0", "*/{$config['system']['dhcpbackup']}");
        }

        write_config();
195
        $savemsg = get_std_save_message();
196 197

        system_resolvconf_generate(true);
198
        filter_configure();
199 200 201 202 203 204 205
        activate_powerd();
        load_crypto();
        load_thermal_hardware();
        if ($need_relayd_restart) {
            relayd_configure();
        }
    }
Ad Schellevis's avatar
Ad Schellevis committed
206 207
}

208
$pgtitle = array(gettext("System"),gettext("Settings"),gettext("Miscellaneous"));
Ad Schellevis's avatar
Ad Schellevis committed
209 210 211 212
include("head.inc");

?>

213 214
<body>
    <?php
215
    include("fbegin.inc");
216 217 218 219
    ?>
    <script type="text/javascript">
    //<![CDATA[
    function sticky_checked(obj) {
220 221 222 223
	if (obj.checked)
		jQuery('#srctrack').attr('disabled',false);
	else
		jQuery('#srctrack').attr('disabled','true');
224 225
    }
    function tmpvar_checked(obj) {
226 227 228
	if (obj.checked) {
		jQuery('#rrdbackup').attr('disabled',false);
		jQuery('#dhcpbackup').attr('disabled',false);
229 230
		jQuery('#rrdbackup').selectpicker('refresh');
		jQuery('#dhcpbackup').selectpicker('refresh');
231 232 233
	} else {
		jQuery('#rrdbackup').attr('disabled','true');
		jQuery('#dhcpbackup').attr('disabled','true');
234 235
		jQuery('#rrdbackup').selectpicker('refresh');
		jQuery('#dhcpbackup').selectpicker('refresh');
236
	}
237 238 239 240 241 242 243 244 245
    }
    //]]>
    </script>

<!-- row -->
<section class="page-content-main">
	<div class="container-fluid">
        <div class="row">
            <?php
246
            if (isset($input_errors) && count($input_errors) > 0) {
247 248
                print_input_errors($input_errors);
            }
249
            if (isset($savemsg)) {
250 251
                print_info_box($savemsg);
            }
252 253
            ?>
            <section class="col-xs-12">
254
                <div class="content-box tab-content">
255
					<form action="system_advanced_misc.php" method="post" name="iform" id="iform">
256 257
						<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area" class="table table-striped">
							<thead>
258 259 260
							<tr>
								<th colspan="2" valign="top" class="listtopic"><?=gettext("Proxy support"); ?></th>
							</tr>
261
							</thead>
262

263
							<tbody>
264 265 266
								<tr>
									<td width="22%" valign="top" class="vncell"><?=gettext("Proxy URL"); ?></td>
									<td width="78%" class="vtable">
267 268 269
										<input name="proxyurl" id="proxyurl" type="text" value="<?php if ($pconfig['proxyurl'] <> "") {
                                            echo $pconfig['proxyurl'];
} ?>" class="formfld unknown" />
270
										<br />
271
										<?php printf(gettext("Proxy url for allowing %s to use this proxy to connect outside."), $g['product']); ?>
272 273 274 275 276
									</td>
								</tr>
								<tr>
									<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Port"); ?></td>
									<td width="78%" class="vtable">
277 278 279
										<input name="proxyport" id="proxyport" type="text" value="<?php if ($pconfig['proxyport'] <> "") {
                                            echo $pconfig['proxyport'];
} ?>" class="formfld unknown" />
280
										<br />
281
										<?php printf(gettext("Proxy port to use when %s connects to the proxy URL configured above. Default is 8080 for http protocol or 443 for ssl."), $g['product']); ?>
282 283 284 285 286
									</td>
								</tr>
								<tr>
									<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Username"); ?></td>
									<td width="78%" class="vtable">
287 288 289
										<input name="proxyuser" id="proxyuser" type="text" value="<?php if ($pconfig['proxyuser'] <> "") {
                                            echo $pconfig['proxyuser'];
} ?>" class="formfld unknown" />
290
										<br />
291
										<?php printf(gettext("Proxy username for allowing %s to use this proxy to connect outside"), $g['product']); ?>
292 293 294 295 296
									</td>
								</tr>
								<tr>
									<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Pass"); ?></td>
									<td width="78%" class="vtable">
297 298 299
										<input type="password" name="proxypass" id="proxypass" value="<?php if ($pconfig['proxypass'] <> "") {
                                            echo $pconfig['proxypass'];
} ?>" class="formfld unknown" />
300
										<br />
301
										<?php printf(gettext("Proxy password for allowing %s to use this proxy to connect outside"), $g['product']); ?>
302 303 304 305
									</td>
								</tr>

								<tr>
306
									<th colspan="2" valign="top" class="listtopic"><?=gettext("Load Balancing"); ?></th>
307 308
								</tr>
								<tr>
309
									<td width="22%" valign="top" class="vncell"></td>
310
									<td width="78%" class="vtable">
311 312 313 314 315 316 317 318
										<input name="gw_switch_default" type="checkbox" id="gw_switch_default" value="yes" <?php if ($pconfig['gw_switch_default']) {
                                            echo "checked=\"checked\"";
} ?> />
										<strong><?=gettext("Allow default gateway switching"); ?></strong><br />
										<?=gettext("If the link where the default gateway resides fails " .
                                        "switch the default gateway to another available one."); ?>
										<br />
										<br />
319 320 321
										<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) {
                                            echo "checked=\"checked\"";
} ?> onclick="sticky_checked(this)" />
322 323
										<strong><?=gettext("Use sticky connections"); ?></strong><br />
										<?=gettext("Successive connections will be redirected to the servers " .
324 325 326 327 328 329 330
                                        "in a round-robin manner with connections from the same " .
                                        "source being sent to the same web server. This 'sticky " .
                                        "connection' will exist as long as there are states that " .
                                        "refer to this connection. Once the states expire, so will " .
                                        "the sticky connection. Further connections from that host " .
                                        "will be redirected to the next web server in the round " .
                                        "robin. Changing this option will restart the Load Balancing service."); ?>
331
										<br />
332
										<br />
333 334 335 336 337 338 339 340
										<input name="srctrack" id="srctrack" type="text" value="<?php if ($pconfig['srctrack'] <> "") {
                                            echo $pconfig['srctrack'];

} else {
    "1400";
} ?>" class="formfld unknown" <?php if ($pconfig['lb_use_sticky'] == false) {
    echo "disabled=\"disabled\"";
} ?> />
341
										<?=gettext("Set the source tracking timeout for sticky connections. " .
342 343
                                        "By default this is 0, so source tracking is removed as soon as the state expires. " .
                                        "Setting this timeout higher will cause the source/destination relationship to persist for longer periods of time."); ?>
344 345 346 347 348 349
									</td>
								</tr>
								<tr>
									<th colspan="2" valign="top" class="listtopic"><?=gettext("Power savings"); ?></th>
								</tr>
								<tr>
350
									<td width="22%" valign="top" class="vncell"></td>
351
									<td width="78%" class="vtable">
352 353 354
										<input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?php if ($pconfig['powerd_enable']) {
                                            echo "checked=\"checked\"";
} ?> />
355 356 357 358
										<strong><?=gettext("Use PowerD"); ?></strong><br />
										<br />
										<?=gettext("On AC Power Mode"); ?>&nbsp;:&nbsp;
										<select name="powerd_ac_mode" id="powerd_ac_mode" class="selectpicker" data-style="btn-default" data-width="auto">
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
											<option value="hadp"<?php if ($pconfig['powerd_ac_mode']=="hadp") {
                                                echo " selected=\"selected\"";

} ?>><?=gettext("Hiadaptive");?></option>
											<option value="adp"<?php if ($pconfig['powerd_ac_mode']=="adp") {
                                                echo " selected=\"selected\"";

} ?>><?=gettext("Adaptive");?></option>
											<option value="min"<?php if ($pconfig['powerd_ac_mode']=="min") {
                                                echo " selected=\"selected\"";

} ?>><?=gettext("Minimum");?></option>
											<option value="max"<?php if ($pconfig['powerd_ac_mode']=="max") {
                                                echo " selected=\"selected\"";

} ?>><?=gettext("Maximum");?></option>
375 376 377 378
										</select>
										&nbsp;&nbsp;
										<?=gettext("On Battery Power Mode"); ?>&nbsp;:&nbsp;
										<select name="powerd_battery_mode" id="powerd_battery_mode" class="selectpicker" data-style="btn-default" data-width="auto">
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
											<option value="hadp"<?php if ($pconfig['powerd_battery_mode']=="hadp") {
                                                echo " selected=\"selected\"";

} ?>><?=gettext("Hiadaptive");?></option>
											<option value="adp"<?php if ($pconfig['powerd_battery_mode']=="adp") {
                                                echo " selected=\"selected\"";

} ?>><?=gettext("Adaptive");?></option>
											<option value="min"<?php if ($pconfig['powerd_battery_mode']=="min") {
                                                echo " selected=\"selected\"";

} ?>><?=gettext("Minimum");?></option>
											<option value="max"<?php if ($pconfig['powerd_battery_mode']=="max") {
                                                echo " selected=\"selected\"";

} ?>><?=gettext("Maximum");?></option>
395 396 397
										</select>
										<br /><br />
										<?=gettext("The powerd utility monitors the system state and sets various power control " .
398 399 400 401 402 403 404 405 406 407 408 409
                                        "options accordingly.  It offers four modes (maximum, minimum, adaptive " .
                                        "and hiadaptive) that can be individually selected while on AC power or batteries. " .
                                        "The modes maximum, minimum, adaptive and hiadaptive may be abbreviated max, " .
                                        "min, adp, hadp.  Maximum mode chooses the highest performance values.  Minimum " .
                                        "mode selects the lowest performance values to get the most power savings. " .
                                        "Adaptive mode attempts to strike a balance by degrading performance when " .
                                        "the system appears idle and increasing it when the system is busy.  It " .
                                        "offers a good balance between a small performance loss for greatly " .
                                        "increased power savings.  Hiadaptive mode is alike adaptive mode, but " .
                                        "tuned for systems where performance and interactivity are more important " .
                                        "than power consumption.  It raises frequency faster, drops slower and " .
                                        "keeps twice lower CPU load."); ?>
410 411 412 413 414 415
									</td>
								</tr>
								<tr>
									<th colspan="2" valign="top" class="listtopic"><?=gettext("Cryptographic Hardware Acceleration"); ?></th>
								</tr>
								<tr>
416
									<td width="22%" valign="top" class="vncell"></td>
417 418 419
									<td width="78%" class="vtable">
										<select name="crypto_hardware" id="crypto_hardware" class="selectpicker" data-style="btn-default">
											<option value=""><?php echo gettext("None"); ?></option>
420 421 422 423 424 425 426
											<?php foreach ($crypto_modules as $cryptomod_name => $cryptomod_descr) :
?>
												<option value="<?php echo $cryptomod_name; ?>" <?php if ($pconfig['crypto_hardware'] == $cryptomod_name) {
                                                    echo " selected=\"selected\"";
} ?>><?php echo "{$cryptomod_descr} ({$cryptomod_name})"; ?></option>
											<?php
endforeach; ?>
427 428 429
										</select>
										<br />
										<?=gettext("A cryptographic accelerator module will use hardware support to speed up some " .
430 431 432 433 434 435
                                            "cryptographic functions on systems which have the chip. Do not enable this " .
                                            "option if you have a Hifn cryptographic acceleration card, as this will take " .
                                            "precedence and the Hifn card will not be used. Acceleration should be automatic " .
                                            "for IPsec when using a cipher supported by your chip, such as AES-128. OpenVPN " .
                                            "should be set for AES-128-CBC and have cryptodev enabled for hardware " .
                                            "acceleration."); ?>
436 437
										<br /><br />
										<?=gettext("If you do not have a crypto chip in your system, this option will have no " .
438
                                        "effect. To unload the selected module, set this option to 'none' and then reboot."); ?>
439 440 441 442 443 444
									</td>
								</tr>
								<tr>
									<th colspan="2" valign="top" class="listtopic"><?=gettext("Thermal Sensors"); ?></th>
								</tr>
								<tr>
445
									<td width="22%" valign="top" class="vncell"></td>
446 447 448
									<td width="78%" class="vtable">
									<select name="thermal_hardware" id="thermal_hardware" class="selectpicker" data-style="btn-default">
										<option value=""><?php echo gettext("None/ACPI"); ?></option>
449 450 451 452 453 454 455
										<?php foreach ($thermal_hardware_modules as $themalmod_name => $themalmod_descr) :
?>
											<option value="<?php echo $themalmod_name; ?>" <?php if ($pconfig['thermal_hardware'] == $themalmod_name) {
                                                echo " selected=\"selected\"";
} ?>><?php echo "{$themalmod_descr} ({$themalmod_name})"; ?></option>
										<?php
endforeach; ?>
Ad Schellevis's avatar
Ad Schellevis committed
456 457
									</select>
									<br />
458
									<?=gettext("If you have a supported CPU, selecting a themal sensor will load the appropriate " .
459 460
                                            "driver to read its temperature. Setting this to 'None' will attempt to read the " .
                                            "temperature from an ACPI-compliant motherboard sensor instead, if one is present."); ?>
Ad Schellevis's avatar
Ad Schellevis committed
461
									<br /><br />
462
									<?=gettext("If you do not have a supported thermal sensor chip in your system, this option will have no " .
463
                                        "effect. To unload the selected module, set this option to 'none' and then reboot."); ?>
464 465 466 467 468 469
									</td>
								</tr>
								<tr>
									<th colspan="2" valign="top" class="listtopic"><?=gettext("Schedules"); ?></th>
								</tr>
								<tr>
470
									<td width="22%" valign="top" class="vncell"></td>
471
									<td width="78%" class="vtable">
472 473 474
										<input name="schedule_states" type="checkbox" id="schedule_states" value="yes" <?php if ($pconfig['schedule_states']) {
                                            echo "checked=\"checked\"";
} ?> />
475
										<strong><?=gettext("Schedule States"); ?></strong>
476 477
										<br />
										<?=gettext("By default schedules clear the states of existing connections when the expiration time has come. ".
478
                                        "This option overrides that behavior by not clearing states for existing connections."); ?>
479 480 481 482 483 484
									</td>
								</tr>
								<tr>
									<th colspan="2" valign="top" class="listtopic"><?=gettext("Gateway Monitoring"); ?></th>
								</tr>
								<tr>
485
									<td width="22%" valign="top" class="vncell"></td>
486
									<td width="78%" class="vtable">
487 488 489
										<input name="kill_states" type="checkbox" id="kill_states" value="yes" <?php if ($pconfig['kill_states']) {
                                            echo "checked=\"checked\"";
} ?> />
490
										</strong><?=gettext("State Killing on Gateway Failure"); ?></strong>
491 492
										<br />
										<?=gettext("The monitoring process will flush states for a gateway that goes down if this box is not checked. Check this box to disable this behavior."); ?>
493 494
										<br />
										<br />
495 496 497
										<input name="skip_rules_gw_down" type="checkbox" id="skip_rules_gw_down" value="yes" <?php if ($pconfig['skip_rules_gw_down']) {
                                            echo "checked=\"checked\"";
} ?> />
498
										<strong><?=gettext("Skip rules when gateway is down"); ?></strong>
499 500
										<br />
										<?=gettext("By default, when a rule has a specific gateway set, and this gateway is down, ".
501 502
                                        "rule is created and traffic is sent to default gateway.This option overrides that behavior ".
                                        "and the rule is not created when gateway is down"); ?>
503 504 505
									</td>
								</tr>
								<tr>
506
									<th colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></th>
507 508 509 510
								</tr>
								<tr>
									<td width="22%" valign="top" class="vncell"><?=gettext("Use RAM Disks"); ?></td>
									<td width="78%" class="vtable">
511 512 513
										<input name="use_mfs_tmpvar" type="checkbox" id="use_mfs_tmpvar" value="yes" <?php if ($pconfig['use_mfs_tmpvar']) {
                                            echo "checked=\"checked\"";
} ?> onclick="tmpvar_checked(this)" />
514 515
										<strong><?=gettext("Use memory file system for /tmp and /var"); ?></strong><br />
										<?=gettext("Set this if you wish to use /tmp and /var as RAM disks (memory file system disks) on a full install " .
516
                                        "rather than use the hard disk. Setting this will cause the data in /tmp and /var to be lost at reboot, including log data. RRD and DHCP Leases will be retained."); ?>
517 518 519 520 521
									</td>
								</tr>
								<tr>
									<td width="22%" valign="top" class="vncell"><?=gettext("Periodic RRD Backup");?></td>
									<td width="78%" class="vtable">
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538
										<select name="rrdbackup" class="selectpicker" data-style="btn-default" id="rrdbackup" <?php if ($pconfig['use_mfs_tmpvar'] == false) {
                                            echo "disabled=\"disabled\"";
} ?> >
											<option value='0' <?php if (!isset($config['system']['rrdbackup']) || ($config['system']['rrdbackup'] == 0)) {
                                                echo "selected='selected'";

} ?>><?=gettext("Disable"); ?></option>
										<?php for ($x=1; $x<=24; $x++) {
?>
											<option value='<?= $x ?>' <?php if ($config['system']['rrdbackup'] == $x) {
                                                echo "selected='selected'";

} ?>><?= $x ?> <?=gettext("hour"); ?><?php if ($x>1) {
    echo "s";
} ?></option>
										<?php
} ?>
539 540 541 542 543 544 545 546 547 548
										</select>
										<br />
										<?=gettext("This will periodically backup the RRD data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?>
										<br />
										<br />
									</td>
								</tr>
								<tr>
									<td width="22%" valign="top" class="vncell"><?=gettext("Periodic DHCP Leases Backup");?></td>
									<td width="78%" class="vtable">
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565
										<select name="dhcpbackup" class="selectpicker" data-style="btn-default" id="dhcpbackup" <?php if ($pconfig['use_mfs_tmpvar'] == false) {
                                            echo "disabled=\"disabled\"";
} ?> >
											<option value='0' <?php if (!isset($config['system']['dhcpbackup']) || ($config['system']['dhcpbackup'] == 0)) {
                                                echo "selected='selected'";

} ?>><?=gettext("Disable"); ?></option>
										<?php for ($x=1; $x<=24; $x++) {
?>
											<option value='<?= $x ?>' <?php if ($config['system']['dhcpbackup'] == $x) {
                                                echo "selected='selected'";

} ?>><?= $x ?> <?=gettext("hour"); ?><?php if ($x>1) {
    echo "s";
} ?></option>
										<?php
} ?>
566 567 568 569 570 571 572 573 574 575 576 577 578
										</select>
										<br />
										<?=gettext("This will periodically backup the DHCP leases data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?>
										<br />
										<br />
									</td>
								</tr>
								<tr>
									<td width="22%" valign="top">&nbsp;</td>
									<td width="78%">
										<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" />
									</td>
								</tr>
579 580
							</tbody>
						</table>
581
		            </form>
582 583 584 585 586 587
	            </div>
            </section>
        </div>
	</div>
</section>

588
<?php include("foot.inc");