|
273 | 273 | $config['system']['use_mfs_var_size'] = $_POST['use_mfs_var_size'];
|
274 | 274 |
|
275 | 275 | if (isset($_POST['rrdbackup'])) {
|
276 |
| - $config['system']['rrdbackup'] = $_POST['rrdbackup']; |
| 276 | + if (($_POST['rrdbackup'] > 0) && ($_POST['rrdbackup'] <= 24)) { |
| 277 | + $config['system']['rrdbackup'] = intval($_POST['rrdbackup']); |
| 278 | + } else { |
| 279 | + unset($config['system']['rrdbackup']); |
| 280 | + } |
277 | 281 | install_cron_job("/etc/rc.backup_rrd.sh", ($config['system']['rrdbackup'] > 0), $minute="0", "*/{$config['system']['rrdbackup']}");
|
278 | 282 | }
|
279 | 283 | if (isset($_POST['dhcpbackup'])) {
|
280 |
| - $config['system']['dhcpbackup'] = $_POST['dhcpbackup']; |
| 284 | + if (($_POST['dhcpbackup'] > 0) && ($_POST['dhcpbackup'] <= 24)) { |
| 285 | + $config['system']['dhcpbackup'] = intval($_POST['dhcpbackup']); |
| 286 | + } else { |
| 287 | + unset($config['system']['dhcpbackup']); |
| 288 | + } |
281 | 289 | install_cron_job("/etc/rc.backup_dhcpleases.sh", ($config['system']['dhcpbackup'] > 0), $minute="0", "*/{$config['system']['dhcpbackup']}");
|
282 | 290 | }
|
283 | 291 |
|
|
543 | 551 | 'Periodic RRD Backup',
|
544 | 552 | 'number',
|
545 | 553 | $config['system']['rrdbackup'],
|
546 |
| - ['min' => 1, 'max' => 24, 'placeholder' => 'frequency between 1 and 24 hours'] |
| 554 | + ['min' => 0, 'max' => 24, 'placeholder' => 'Period between 1 and 24 hours'] |
547 | 555 | ))->setHelp('This will periodically backup the RRD data so '.
|
548 | 556 | 'it can be restored automatically on the next boot. Keep in mind that the more '.
|
549 | 557 | 'frequent the backup, the more writes will happen to the media.');
|
|
553 | 561 | 'Periodic DHCP Leases Backup',
|
554 | 562 | 'number',
|
555 | 563 | $config['system']['dhcpbackup'],
|
556 |
| - ['min' => 1, 'max' => 24, 'placeholder' => 'frequency between 1 and 24 hours'] |
| 564 | + ['min' => 0, 'max' => 24, 'placeholder' => 'Period between 1 and 24 hours'] |
557 | 565 | ))->setHelp('This will periodically backup the DHCP leases so '.
|
558 | 566 | 'it can be restored automatically on the next boot. Keep in mind that the more '.
|
559 | 567 | 'frequent the backup, the more writes will happen to the media.');
|
|
0 commit comments