diff options
author | jim-p <jimp@pfsense.org> | 2013-08-28 11:56:01 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-08-28 11:56:01 -0400 |
commit | e4651022d0b5b79684d60f0f52bbf3588ce6c943 (patch) | |
tree | 2d8a8c7c74749d2b03f63179c65a6b901fc85984 /config/servicewatchdog | |
parent | ca34f8ee173d3a76ad7f3af85dea6d6ae97c49db (diff) | |
download | pfsense-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.
Diffstat (limited to 'config/servicewatchdog')
-rw-r--r-- | config/servicewatchdog/services_servicewatchdog_add.php | 6 | ||||
-rw-r--r-- | config/servicewatchdog/servicewatchdog.xml | 2 |
2 files changed, 5 insertions, 3 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> |