aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-08-28 11:56:01 -0400
committerjim-p <jimp@pfsense.org>2013-08-28 11:56:01 -0400
commite4651022d0b5b79684d60f0f52bbf3588ce6c943 (patch)
tree2d8a8c7c74749d2b03f63179c65a6b901fc85984
parentca34f8ee173d3a76ad7f3af85dea6d6ae97c49db (diff)
downloadpfsense-packages-e4651022d0b5b79684d60f0f52bbf3588ce6c943.tar.gz
pfsense-packages-e4651022d0b5b79684d60f0f52bbf3588ce6c943.tar.bz2
pfsense-packages-e4651022d0b5b79684d60f0f52bbf3588ce6c943.zip
Service Watchdog: If the description is empty, try to fetch the package description instead. Also, don't offer cron in the list of services to monitor. Don't show blank/empty services. Bump version.
-rw-r--r--config/servicewatchdog/services_servicewatchdog_add.php6
-rw-r--r--config/servicewatchdog/servicewatchdog.xml2
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
4 files changed, 7 insertions, 5 deletions
diff --git a/config/servicewatchdog/services_servicewatchdog_add.php b/config/servicewatchdog/services_servicewatchdog_add.php
index e5335540..791b973d 100644
--- a/config/servicewatchdog/services_servicewatchdog_add.php
+++ b/config/servicewatchdog/services_servicewatchdog_add.php
@@ -44,7 +44,8 @@ if (!is_array($config['installedpackages']['servicewatchdog']['item'])) {
$config['installedpackages']['servicewatchdog']['item'] = array();
}
$a_pwservices = &$config['installedpackages']['servicewatchdog']['item'];
-$a_pwservice_names = array();
+// Pre-load "cron" into this array to blacklist it from being offered as a choice.
+$a_pwservice_names = array("cron");
foreach ($a_pwservices as $svc) {
$a_pwservice_names[] = $svc['name'];
}
@@ -94,7 +95,8 @@ include("head.inc");
<select name="svcid" class="formselect" id="svcid">
<?php $i=0;
foreach ($system_services as $svc): ?>
- <?php if (!in_array($svc['name'], $a_pwservice_names)): ?>
+ <?php if (!empty($svc['name']) && !in_array($svc['name'], $a_pwservice_names)): ?>
+ <?php $svc['description'] = empty($svc['description']) ? get_pkg_descr($svc['name']) : $svc['description']; ?>
<option value="<?= $i ?>"><?=$svc['name'];?>: <?= strlen($svc['description']) > 50 ? substr($svc['description'], 0, 50) . "..." : $svc['description'];?></option>
<?php endif;
$i++; ?>
diff --git a/config/servicewatchdog/servicewatchdog.xml b/config/servicewatchdog/servicewatchdog.xml
index 4a6fd6a8..49556a01 100644
--- a/config/servicewatchdog/servicewatchdog.xml
+++ b/config/servicewatchdog/servicewatchdog.xml
@@ -40,7 +40,7 @@
<requirements>None</requirements>
<faq>Monitors for stopped services and restarts them.</faq>
<name>Service Watchdog</name>
- <version>1.1</version>
+ <version>1.2</version>
<title>Services: Service Watchdog</title>
<include_file>/usr/local/pkg/servicewatchdog.inc</include_file>
<menu>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 497305a2..4653345c 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -1954,7 +1954,7 @@
<name>Service Watchdog</name>
<descr>Monitors for stopped services and restarts them.</descr>
<maintainer>jimp@pfsense.org</maintainer>
- <version>1.1</version>
+ <version>1.2</version>
<category>Services</category>
<status>BETA</status>
<config_file>http://www.pfsense.com/packages/config/servicewatchdog/servicewatchdog.xml</config_file>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index ff3c9758..8d88316c 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -1941,7 +1941,7 @@
<name>Service Watchdog</name>
<descr>Monitors for stopped services and restarts them.</descr>
<maintainer>jimp@pfsense.org</maintainer>
- <version>1.1</version>
+ <version>1.2</version>
<category>Services</category>
<status>BETA</status>
<config_file>http://www.pfsense.com/packages/config/servicewatchdog/servicewatchdog.xml</config_file>