From 429adb3b2dc66541670245bb63e0b952fda0617b Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 28 Aug 2013 16:16:38 -0400 Subject: Teach blinkled how to write an rcfile since it claims to use one in its service definition. --- config/blinkled8/blinkled.inc | 37 ++++++++++++++++++++++++++++++++++--- config/blinkled8/blinkled.xml | 2 +- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/config/blinkled8/blinkled.inc b/config/blinkled8/blinkled.inc index d50cc022..f466da94 100644 --- a/config/blinkled8/blinkled.inc +++ b/config/blinkled8/blinkled.inc @@ -1,10 +1,36 @@ 'blinkled.sh', + 'start' => $start, + 'stop' => $stop) + ); + conf_mount_ro(); +} + function blinkled_running () { return ((int)exec('pgrep blinkled | wc -l') > 0); } - function sync_package_blinkled() { global $config; $blinkled_config = $config['installedpackages']['blinkled']['config'][0]; @@ -16,10 +42,15 @@ function sync_package_blinkled() { if(!blinkled_running()) { blinkled_start(); } + blinkled_rcfile(); } -function blinkled_launch($int, $led) { - mwexec("/usr/local/bin/blinkled -i " . escapeshellarg($int) . " -l /dev/led/led" . escapeshellarg($led)); +function blinkled_launch($int, $led, $return = false) { + $cmd = "/usr/local/bin/blinkled -i " . escapeshellarg($int) . " -l " . escapeshellarg("/dev/led/led{$led}"); + if ($return) + return $cmd; + else + mwexec($cmd); } function blinkled_start() { diff --git a/config/blinkled8/blinkled.xml b/config/blinkled8/blinkled.xml index 298ba42e..5fb5ff7c 100644 --- a/config/blinkled8/blinkled.xml +++ b/config/blinkled8/blinkled.xml @@ -2,7 +2,7 @@ Interfaces: Assign LEDs blinkled - 20090710 + 0.4 Save /usr/local/pkg/blinkled.inc diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 4653345c..beb9fea2 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1490,7 +1490,7 @@ blinkled Allows you to use LEDs for network activity on supported platforms (ALIX, WRAP, Soekris, etc) System - 0.3 + 0.4 Beta jimp@pfsense.org 1.2.3 diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 8d88316c..86cb6d54 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1477,7 +1477,7 @@ blinkled Allows you to use LEDs for network activity on supported platforms (ALIX, WRAP, Soekris, etc) System - 0.3 + 0.4 Beta jimp@pfsense.org 1.2.3 -- cgit v1.2.3