system: upper half for #2876

This commit is contained in:
Franco Fichtner 2018-11-17 14:46:27 +01:00
parent 3831ea06a0
commit 7b2b072449
2 changed files with 20 additions and 24 deletions

View File

@ -176,7 +176,7 @@ function core_cron()
$jobs[]['autocron'] = array('/usr/local/sbin/ping_hosts.sh', '*/4');
if (!empty($config['system']['rrdbackup'])) {
if (!empty($config['system']['rrdbackup']) && $config['system']['rrdbackup'] > 0) {
$jobs[]['autocron'] = array(
'/usr/local/etc/rc.syshook.d/backup/20-rrd',
'0',
@ -184,7 +184,7 @@ function core_cron()
);
}
if (!empty($config['system']['dhcpbackup'])) {
if (!empty($config['system']['dhcpbackup']) && $config['system']['dhcpbackup'] > 0) {
$jobs[]['autocron'] = array(
'/usr/local/etc/rc.syshook.d/backup/20-dhcpleases',
'0',
@ -192,7 +192,7 @@ function core_cron()
);
}
if (!empty($config['system']['netflowbackup'])) {
if (!empty($config['system']['netflowbackup']) && $config['system']['netflowbackup'] > 0) {
$jobs[]['autocron'] = array(
'/usr/local/etc/rc.syshook.d/backup/20-netflow',
'0',
@ -200,7 +200,7 @@ function core_cron()
);
}
if (!empty($config['system']['captiveportalbackup'])) {
if (!empty($config['system']['captiveportalbackup']) && $config['system']['captiveportalbackup'] > 0) {
$jobs[]['autocron'] = array(
'/usr/local/etc/rc.syshook.d/backup/20-captiveportal',
'0',

View File

@ -334,14 +334,13 @@ include("head.inc");
<td><a id="help_for_rrdbackup" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Periodic RRD Backup");?></td>
<td>
<select name="rrdbackup" class="selectpicker" data-style="btn-default" id="rrdbackup">
<option value='0' <?=!$pconfig['rrdbackup'] == 0 ? 'selected="selected"' : ''; ?>><?=gettext("Disabled"); ?></option>
<?php
for ($x = 1; $x <= 24; $x++): ?>
<option value='0' <?=!$pconfig['rrdbackup'] == 0 ? 'selected="selected"' : '' ?>><?= gettext('Power off') ?></option>
<?php for ($x = 1; $x <= 24; $x++): ?>
<option value="<?= $x ?>" <?= $pconfig['rrdbackup'] == $x ? 'selected="selected"' : ''; ?>>
<?= $x == 1 ? gettext('1 hour') : sprintf(gettext('%s hours'), $x) ?>
</option>
<?php
endfor; ?>
<?php endfor ?>
<option value='-1' <?=!$pconfig['rrdbackup'] == -1 ? 'selected="selected"' : '' ?>><?=gettext('Disabled') ?></option>
</select>
<br />
<div class="hidden" data-for="help_for_rrdbackup">
@ -353,14 +352,13 @@ include("head.inc");
<td><a id="help_for_dhcpbackup" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Periodic DHCP Leases Backup");?></td>
<td>
<select name="dhcpbackup" class="selectpicker" data-style="btn-default" id="dhcpbackup">
<option value='0' <?= $pconfig['dhcpbackup'] == 0 ? "selected='selected'" : ''; ?>><?=gettext('Disabled'); ?></option>
<?php
for ($x = 1; $x <= 24; $x++): ?>
<option value='0' <?= $pconfig['dhcpbackup'] == 0 ? "selected='selected'" : '' ?>><?= gettext('Power off') ?></option>
<?php for ($x = 1; $x <= 24; $x++): ?>
<option value="<?= $x ?>" <?= $pconfig['dhcpbackup'] == $x ? 'selected="selected"' : '';?>>
<?= $x == 1 ? gettext('1 hour') : sprintf(gettext('%s hours'), $x) ?>
</option>
<?php
endfor; ?>
<?php endfor ?>
<option value='-1' <?= $pconfig['dhcpbackup'] == -1 ? "selected='selected'" : '' ?>><?= gettext('Disabled') ?></option>
</select>
<div class="hidden" data-for="help_for_dhcpbackup">
<?=gettext("This will periodically backup the DHCP leases data so it can be restored automatically on the next boot.");?>
@ -371,14 +369,13 @@ include("head.inc");
<td><a id="help_for_netflowbackup" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Periodic NetFlow Backup");?></td>
<td>
<select name="netflowbackup" class="selectpicker" data-style="btn-default" id="netflowbackup">
<option value='0' <?= $pconfig['netflowbackup'] == 0 ? 'selected="selected"' : ''; ?>><?=gettext('Disabled'); ?></option>
<?php
for ($x = 1; $x <= 24; $x++): ?>
<option value='0' <?= $pconfig['netflowbackup'] == 0 ? 'selected="selected"' : '' ?>><?= gettext('Power off') ?></option>
<?php for ($x = 1; $x <= 24; $x++): ?>
<option value="<?= $x ?>" <?= $pconfig['netflowbackup'] == $x ? 'selected="selected"' : '';?>>
<?= $x == 1 ? gettext('1 hour') : sprintf(gettext('%s hours'), $x) ?>
</option>
<?php
endfor; ?>
<?php endfor ?>
<option value='-1' <?= $pconfig['netflowbackup'] == -1 ? 'selected="selected"' : '' ?>><?= gettext('Disabled') ?></option>
</select>
<div class="hidden" data-for="help_for_netflowbackup">
<?=gettext("This will periodically backup the NetFlow data aggregation so it can be restored automatically on the next boot.");?>
@ -389,14 +386,13 @@ include("head.inc");
<td><a id="help_for_captiveportalbackup" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Periodic Captive Portal Backup");?></td>
<td>
<select name="captiveportalbackup" class="selectpicker" data-style="btn-default" id="captiveportalbackup">
<option value='0' <?= $pconfig['captiveportalbackup'] == 0 ? 'selected="selected"' : ''; ?>><?=gettext('Disabled'); ?></option>
<?php
for ($x = 1; $x <= 24; $x++): ?>
<option value='0' <?= $pconfig['captiveportalbackup'] == 0 ? 'selected="selected"' : '' ?>><?= gettext('Power off') ?></option>
<?php for ($x = 1; $x <= 24; $x++): ?>
<option value="<?= $x ?>" <?= $pconfig['captiveportalbackup'] == $x ? 'selected="selected"' : '';?>>
<?= $x == 1 ? gettext('1 hour') : sprintf(gettext('%s hours'), $x) ?>
</option>
<?php
endfor; ?>
<?php endfor ?>
<option value='-1' <?= $pconfig['captiveportalbackup'] == -1 ? 'selected="selected"' : '' ?>><?= gettext('Disabled') ?></option>
</select>
<div class="hidden" data-for="help_for_captiveportalbackup">
<?=gettext("This will periodically backup the captive portal session data so it can be restored automatically on the next boot.");?>