From fc15c06f6f8e135ac5ec2819702b9eb03882a747 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 12:02:24 +0200 Subject: cron - rewrite broken package - Remove cron service and other unused junk - Clean up after previous broken versions - Add a check for running cron after configure_cron() call. (TODO: Move this to pfSense core.) --- config/cron/cron.inc | 65 +++++++++------------------------------------------- 1 file changed, 11 insertions(+), 54 deletions(-) (limited to 'config/cron') diff --git a/config/cron/cron.inc b/config/cron/cron.inc index a457cf58..7a7a8993 100644 --- a/config/cron/cron.inc +++ b/config/cron/cron.inc @@ -1,14 +1,11 @@ /dev/null"); + } } - function cron_install_command() { - - global $config; conf_mount_rw(); - - //write_config(); - - write_rcfile(array( - "file" => "cron.sh", - "start" => "[ `/bin/pgrep -f 'cron -s' | wc -l` -eq 0 ] && /usr/sbin/cron -s &", - "stop" => "[ -f \"/var/run/cron.pid\" ] && kill -9 `cat /var/run/cron.pid`; rm -f /var/run/cron.pid; /bin/pkill -f 'cron -s'" - ) - ); - - cron_sync_package(); - - //if (pkg_is_service_running('cron')) { - //documentation purposes - //} - - conf_mount_ro(); - -} - - -function cron_deinstall_command() { - conf_mount_rw(); - exec("/usr/local/etc/rc.d/cron.sh stop"); + // Clean up possible lingering garbage after previous package versions unlink_if_exists("/usr/local/etc/rc.d/cron.sh"); - conf_mount_ro(); + cron_sync_package(); } ?> -- cgit v1.2.3