Patchwork alsa-state: add status command

login
register
mail settings
Submitter jackie huang
Date Nov. 29, 2013, 10:56 a.m.
Message ID <1385722619-3641-1-git-send-email-jackie.huang@windriver.com>
Download mbox | patch
Permalink /patch/62553/
State New
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/alsa-state/alsa-state/alsa-state-init | 10 ++++++++++
 1 file changed, 10 insertions(+)

Patch

diff --git a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
index 9850791..eee59cb 100755
--- a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
+++ b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
@@ -6,6 +6,8 @@ 
 # Filename: alsa-state
 # Date: 20070308 (YMD)
 
+# source function library
+. /etc/init.d/functions
 
 asound_restore(){
 	echo "ALSA: Restoring mixer settings..."
@@ -26,4 +28,12 @@  asound_store(){
 case "$1" in
 start)		asound_restore ;;
 stop)		asound_store ;;
+  status)
+    status /usr/sbin/alsactl;
+    exit $?
+  ;;
+  *)
+    echo "Usage: /etc/init.d/alsa-state {start|stop|status}"
+    exit 1
+  ;;
 esac