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/services_servicewatchdog_add.php | |
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/services_servicewatchdog_add.php')
-rw-r--r-- | config/servicewatchdog/services_servicewatchdog_add.php | 6 |
1 files changed, 4 insertions, 2 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++; ?> |