Package: powernowd
Version: 1.00-1.1
Severity: wishlist
Tags: patch

Here is a patch to add support for the "status" action to the init.d
script of powernowd.
diff -u powernowd-1.00/debian/changelog powernowd-1.00/debian/changelog
--- powernowd-1.00/debian/changelog
+++ powernowd-1.00/debian/changelog
@@ -1,3 +1,9 @@
+powernowd (1.00-1.2) UNRELEASED; urgency=low
+
+  * Add support for "status" action to init.d script
+
+ -- Peter Eisentraut <[email protected]>  Fri, 23 Dec 2011 19:39:29 +0200
+
 powernowd (1.00-1.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u powernowd-1.00/debian/control powernowd-1.00/debian/control
--- powernowd-1.00/debian/control
+++ powernowd-1.00/debian/control
@@ -7,7 +7,7 @@
 
 Package: powernowd
 Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, lsb-base
 Conflicts: cpudyn, cpufreqd
 Description: control cpu speed and voltage using 2.6 kernel interface
  This simple client controls CPU speed and voltage using the sysfs interface
diff -u powernowd-1.00/debian/init.d powernowd-1.00/debian/init.d
--- powernowd-1.00/debian/init.d
+++ powernowd-1.00/debian/init.d
@@ -23,6 +23,8 @@
 
 [ -f /etc/default/$NAME ] && . /etc/default/$NAME
 
+. /lib/lsb/init-functions
+
 set -e
 
 case "$1" in
@@ -43,6 +45,9 @@
 	start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
 	echo "$NAME."
 	;;
+  status)
+	status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+	;;
   restart|force-reload)
 	echo -n "Restarting $DESC: "
 	start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
@@ -52,7 +57,7 @@
 	;;
   *)
 	N=/etc/init.d/$NAME
-	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
 	exit 1
 	;;
 esac

Reply via email to