diff options
author | Phil Davis <phil.davis@inf.org> | 2015-08-06 12:00:26 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-08-06 12:00:26 +0545 |
commit | b3c4b3badcd3eb35a0ec0c469842a70905db881d (patch) | |
tree | e5b0421c22d924a603ef1e8cd091352c6ecd85cf /config/cron/cron.inc | |
parent | 37e90498c6c3fb56bfd28d50b8b85b12fc6fb4fb (diff) | |
download | pfsense-packages-b3c4b3badcd3eb35a0ec0c469842a70905db881d.tar.gz pfsense-packages-b3c4b3badcd3eb35a0ec0c469842a70905db881d.tar.bz2 pfsense-packages-b3c4b3badcd3eb35a0ec0c469842a70905db881d.zip |
Cron package code style
Diffstat (limited to 'config/cron/cron.inc')
-rw-r--r-- | config/cron/cron.inc | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/config/cron/cron.inc b/config/cron/cron.inc index a457f013..0c7c6769 100644 --- a/config/cron/cron.inc +++ b/config/cron/cron.inc @@ -3,10 +3,10 @@ /* /* ========================================================================== */ /* - cron.inc - Copyright (C) 2008 Mark J Crane - All rights reserved. - */ + cron.inc + Copyright (C) 2008 Mark J Crane + All rights reserved. + */ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without @@ -33,35 +33,31 @@ require_once("services.inc"); -function cron_pkg_is_service_running($servicename) -{ +function cron_pkg_is_service_running($servicename) { exec("/bin/ps ax | awk '{ print $5 }'", $psout); array_shift($psout); - foreach($psout as $line) { + foreach ($psout as $line) { $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line))))); } - if(is_service_running($servicename, $ps) or is_process_running($servicename) ) { + if (is_service_running($servicename, $ps) or is_process_running($servicename)) { return true; - } - else { + } else { return false; } } -function cron_sync_package() -{ +function cron_sync_package() { - global $config; + global $config; //synch cron tab configure_cron(); exec("/usr/local/etc/rc.d/cron.sh stop"); exec("/usr/local/etc/rc.d/cron.sh start"); } - -function cron_install_command() -{ + +function cron_install_command() { global $config; conf_mount_rw(); @@ -88,8 +84,7 @@ function cron_install_command() } -function cron_deinstall_command() -{ +function cron_deinstall_command() { conf_mount_rw(); exec("/usr/local/etc/rc.d/cron.sh stop"); unlink_if_exists("/usr/local/etc/rc.d/cron.sh"); |