aboutsummaryrefslogtreecommitdiffstats
path: root/config/cron
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-11-16 22:13:21 +0100
committerdoktornotor <notordoktor@gmail.com>2015-11-16 22:13:21 +0100
commita8ca8e6ee8c2fbd5a7bd15e54ec794c2ac2a3c3f (patch)
tree6f8cb6eb59abb21e3c606f1964b1d72d8973c1fa /config/cron
parent0251c7a9d9a32aa52948689c9ce9fd747e5c66fa (diff)
downloadpfsense-packages-a8ca8e6ee8c2fbd5a7bd15e54ec794c2ac2a3c3f.tar.gz
pfsense-packages-a8ca8e6ee8c2fbd5a7bd15e54ec794c2ac2a3c3f.tar.bz2
pfsense-packages-a8ca8e6ee8c2fbd5a7bd15e54ec794c2ac2a3c3f.zip
Package install/deinstall cleanup
Diffstat (limited to 'config/cron')
-rw-r--r--config/cron/cron.inc16
1 files changed, 12 insertions, 4 deletions
diff --git a/config/cron/cron.inc b/config/cron/cron.inc
index 645575d9..87591e08 100644
--- a/config/cron/cron.inc
+++ b/config/cron/cron.inc
@@ -27,22 +27,30 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
+require_once("pfsense-utils.inc");
require_once("services.inc");
+require_once("util.inc");
function cron_sync_package() {
configure_cron();
// Previous package versions were "helpfully" killing cron on uninstall.
// Also, need to make sure cron is running, otherwise the package is useless.
- // TODO: Something like this needs to be eventually done in configure_cron() in services.inc.
- if (!is_process_running("cron")) {
- exec("cd /tmp && /usr/sbin/cron -s 2>/dev/null");
+ // configure_cron() function in services.inc already does this check on pfSense >=2.2.5
+ $pfs_version = str_replace(".", "", substr(trim(file_get_contents("/etc/version")), 0, 5));
+ if ($pfs_version < 225) {
+ if (!is_process_running("cron")) {
+ exec("cd /tmp && /usr/sbin/cron -s 2>/dev/null");
+ }
}
}
function cron_install_command() {
// Clean up possible lingering garbage after previous package versions
unlink_if_exists("/usr/local/etc/rc.d/cron.sh");
- cron_sync_package();
+}
+
+function cron_deinstall_command() {
+ rmdir_recursive("/usr/local/www/packages/cron");
}
?>