Patchwork apmd: add status command

login
register
mail settings
Submitter jackie huang
Date Nov. 29, 2013, 10:56 a.m.
Message ID <1385722594-3602-1-git-send-email-jackie.huang@windriver.com>
Download mbox | patch
Permalink /patch/62551/
State Accepted
Commit 813aafe53854a744facc3482d6a97bbe9c21dcfa
Headers show

Comments

jackie huang - Nov. 29, 2013, 10:56 a.m.
From: Li Wang <li.wang@windriver.com>

Signed-off-by: Li Wang <li.wang@windriver.com>
---
 meta/recipes-bsp/apmd/apmd-3.2.2-14/init | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-bsp/apmd/apmd-3.2.2-14/init b/meta/recipes-bsp/apmd/apmd-3.2.2-14/init
index 268d4b2..c0b41aa 100755
--- a/meta/recipes-bsp/apmd/apmd-3.2.2-14/init
+++ b/meta/recipes-bsp/apmd/apmd-3.2.2-14/init
@@ -8,6 +8,9 @@ 
 # Short-Description: Advanced Power Management daemon
 ### END INIT INFO
 
+# Source function library.
+. /etc/init.d/functions
+
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 
 [ -f /etc/default/rcS ] && . /etc/default/rcS
@@ -30,13 +33,17 @@  case "$1" in
 		-x /usr/sbin/apmd
 	echo "apmd."
 	;;
+    status)
+	status /usr/sbin/apmd;
+	exit $?
+	;;
     restart|force-reload) 
 	$0 stop
 	$0 start
 	exit
 	;;
     *)
-	echo "Usage: /etc/init.d/apmd {start|stop|restart|force-reload}"
+	echo "Usage: /etc/init.d/apmd {start|stop|status|restart|force-reload}"
 	exit 1
 	;;
 esac