summaryrefslogtreecommitdiffstats
path: root/etc/inc/services.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-11-10 20:09:13 +0000
committerErmal <eri@pfsense.org>2010-11-10 20:09:13 +0000
commite7d3fc15329347ef244123a20af5384e54ce46fd (patch)
tree87b3e40a10a7f62586da46d15437aaf566bce56b /etc/inc/services.inc
parentfa11243673d97addd1af1c08117a03462253acce (diff)
downloadpfsense-e7d3fc15329347ef244123a20af5384e54ce46fd.zip
pfsense-e7d3fc15329347ef244123a20af5384e54ce46fd.tar.gz
Small improvement no functional change.
Diffstat (limited to 'etc/inc/services.inc')
-rw-r--r--etc/inc/services.inc16
1 files changed, 8 insertions, 8 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 79c20d2..9cf128e 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -1251,19 +1251,19 @@ EODAD;
/* configure cron service */
function configure_cron() {
global $g, $config;
+
conf_mount_rw();
/* preserve existing crontab entries */
- $crontab_contents = file_get_contents("/etc/crontab");
- $crontab_contents_a = split("\n", $crontab_contents);
+ $crontab_contents = file("/etc/crontab", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
- for ($i = 0; $i < count($crontab_contents_a); $i++) {
- $item =& $crontab_contents_a[$i];
- if (strpos($item, "# pfSense specific crontab entries") !== false) {
- array_splice($crontab_contents_a, $i - 1);
+ for ($i = 0; $i < count($crontab_contents); $i++) {
+ $cron_item =& $crontab_contents[$i];
+ if (strpos($cron_item, "# pfSense specific crontab entries") !== false) {
+ array_splice($crontab_contents, $i - 1);
break;
}
}
- $crontab_contents = implode("\n", $crontab_contents_a) . "\n";
+ $crontab_contents = implode("\n", $crontab_contents) . "\n";
if (is_array($config['cron']['item'])) {
@@ -1377,4 +1377,4 @@ function install_cron_job($command, $active=false, $minute="0", $hour="*", $mont
configure_cron();
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud