aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormcrane <mctch@yahoo.com>2009-09-20 00:44:37 -0600
committermcrane <mctch@yahoo.com>2009-09-20 00:45:35 -0600
commit7c9fd45678347b2f39ab3240561cf67f95d9c4c5 (patch)
tree458078fbde36891fe2ddd4091a0e7c70646013c0
parent8ded4f10ecbf15a9e536571008df6c04bf211fb2 (diff)
downloadpfsense-packages-7c9fd45678347b2f39ab3240561cf67f95d9c4c5.tar.gz
pfsense-packages-7c9fd45678347b2f39ab3240561cf67f95d9c4c5.tar.bz2
pfsense-packages-7c9fd45678347b2f39ab3240561cf67f95d9c4c5.zip
Cron package spacing changes.
-rw-r--r--config/cron/cron.inc43
1 files changed, 20 insertions, 23 deletions
diff --git a/config/cron/cron.inc b/config/cron/cron.inc
index 19c899e5..ea490b3a 100644
--- a/config/cron/cron.inc
+++ b/config/cron/cron.inc
@@ -35,17 +35,17 @@ require_once("services.inc");
function pkg_is_service_running($servicename)
{
- exec("/bin/ps ax | awk '{ print $5 }'", $psout);
- array_shift($psout);
- foreach($psout as $line) {
- $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
- }
- if(is_service_running($servicename, $ps) or is_process_running($servicename) ) {
- return true;
- }
- else {
- return false;
- }
+ exec("/bin/ps ax | awk '{ print $5 }'", $psout);
+ array_shift($psout);
+ foreach($psout as $line) {
+ $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
+ }
+ if(is_service_running($servicename, $ps) or is_process_running($servicename) ) {
+ return true;
+ }
+ else {
+ return false;
+ }
}
function php_sync_package()
@@ -70,30 +70,29 @@ function php_install_command()
config_lock();
if (!is_dir('/usr/local/www/packages/')) {
- exec("mkdir /usr/local/www/packages/");
+ exec("mkdir /usr/local/www/packages/");
}
-
+
if (!is_dir('/usr/local/www/packages/cron/')) {
- exec("mkdir /usr/local/www/packages/cron/");
+ exec("mkdir /usr/local/www/packages/cron/");
}
-
//rename PHP files from .tmp to .php
exec("cp /tmp/cron.tmp /usr/local/www/packages/cron/cron.php");
unlink_if_exists("/tmp/cron.tmp");
-
+
exec("cp /tmp/cron_edit.tmp /usr/local/www/packages/cron/cron_edit.php");
unlink_if_exists("/tmp/cron_edit.tmp");
-
- //write_config();
-
+
+ //write_config();
+
write_rcfile(array(
"file" => "cron.sh",
"start" => "/usr/sbin/cron -s &",
"stop" => "kill -9 `cat /var/run/cron.pid`"
)
);
-
+
php_sync_package();
//if (pkg_is_service_running('cron')) {
@@ -102,13 +101,12 @@ function php_install_command()
conf_mount_ro();
config_unlock();
-
+
}
function deinstall_command()
{
-
conf_mount_rw();
config_lock();
$handle = popen("/usr/local/etc/rc.d/cron.sh stop", "r");
@@ -118,7 +116,6 @@ function deinstall_command()
//unlink_if_exists("/usr/local/etc/rc.d/cron.sh");
conf_mount_ro();
config_unlock();
-
}
?> \ No newline at end of file