diff options
author | Ermal <eri@pfsense.org> | 2012-11-21 11:52:20 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2012-11-21 11:52:20 +0000 |
commit | c2d9711198dccda055706cd510e76bb963b3fccb (patch) | |
tree | 732da45adc56a6ec6b827ae847432438877d8819 /etc | |
parent | 928d4416047311bf43716a205cafe4f0cb5c0cb1 (diff) | |
download | pfsense-c2d9711198dccda055706cd510e76bb963b3fccb.zip pfsense-c2d9711198dccda055706cd510e76bb963b3fccb.tar.gz |
Unbreak install_cron_job function so it is actually usable when config['cron'] has no entry. This should remove all those package hand rolled copy/paste functions
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/services.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 4a16b77..98177bf 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1940,6 +1940,7 @@ function configure_cron() { /* please maintain the newline at the end of file */ file_put_contents("/etc/crontab", $crontab_contents); + unset($crontab_contents); /* do a HUP kill to force sync changes */ exec('/bin/pkill -HUP cron'); @@ -1989,8 +1990,10 @@ function install_cron_job($command, $active=false, $minute="0", $hour="*", $mont $is_installed = false; - if(!$config['cron']['item']) - return; + if (!is_array($config['cron'])) + $config['cron'] = array(); + if (!is_array($config['cron']['item'])) + $config['cron']['item'] = array(); $x=0; foreach($config['cron']['item'] as $item) { |