From 991f3d0f5edb2dec1ea69b28da406e0108365177 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Mon, 3 Aug 2015 16:08:41 +0200 Subject: gwled.inc - use is_process_running() and nuke pointless functions --- config/gwled/gwled.inc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'config') diff --git a/config/gwled/gwled.inc b/config/gwled/gwled.inc index ce6f23d9..ff62e562 100644 --- a/config/gwled/gwled.inc +++ b/config/gwled/gwled.inc @@ -30,17 +30,13 @@ require_once("functions.inc"); -function gwled_running () { - return ((int)exec('/bin/pgrep -f gwled | /usr/bin/wc -l') > 0); -} - function sync_package_gwled() { global $config; $gwled_config = $config['installedpackages']['gwled']['config'][0]; led_normalize(); /* Kill all instances of gwled */ - if (gwled_running()) { - gwled_stop(); + if (is_process_running("gwled")) { + mwexec("/bin/pkill -9 -f gwled"); } gwled_start(); } @@ -62,10 +58,6 @@ function gwled_start() { } } -function gwled_stop() { - exec("/bin/pkill -9 -f gwled"); -} - function validate_form_gwled($post, &$input_errors) { /* Make sure both aren't using the same interface */ if (($post['gw_led2']) && ($post['gw_led3']) && -- cgit v1.2.3