[nas] [PATCH] add "reset" argument to rc script

Erik Auerswald auerswal at unix-ag.uni-kl.de
Sun Nov 26 22:06:14 MST 2006


Hi,

the attached patch adds the reset functionality of nasd to the rc
script. I don't know if anybody uses this script, but I think adding
this is some kind of documentation...

Erik
-------------- next part --------------
Index: contrib/rc/nasd
===================================================================
--- contrib/rc/nasd	(revision 179)
+++ contrib/rc/nasd	(working copy)
@@ -6,6 +6,7 @@
 export AUDIOSERVER
 PIDFILE=/var/tmp/aupid
 AU=/usr/X11R6/bin/nasd
+AUOPTIONS="-aa"
 
 # Set these up, and uncomment their calls below if you want
 # a sound to be played at startup and shutdown
@@ -17,7 +18,7 @@
 start ()
 {
 	echo "Starting nasd"
-	$AU -aa &
+	$AU $AUOPTIONS &
 	AUPID=$!
 	umask 077
 	rm -f $PIDFILE
@@ -37,9 +38,16 @@
 stop()
 {
 	# $AUPLAY $DOWNSOUND
+	echo "Stopping nasd"
 	kill -15 `cat $PIDFILE`
 }
 
+au_reset()
+{
+	echo "Resetting nasd"
+	kill -1 `cat $PIDFILE`
+}
+
 case $1 in
 start)
 	start
@@ -47,8 +55,11 @@
 stop)
 	stop
 	;;
+reset)
+	au_reset
+	;;
 *)
-	echo "Usage: $0 start|stop"
+	echo "Usage: $0 start|stop|reset"
 	;;
 esac
 


More information about the Nas mailing list