Author: glen                         Date: Sun Feb 25 12:28:01 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- pldize, use functions

---- Files affected:
SOURCES:
   ipw3945d-init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/ipw3945d-init
diff -u SOURCES/ipw3945d-init:1.1 SOURCES/ipw3945d-init:1.2
--- SOURCES/ipw3945d-init:1.1   Sun Feb 25 12:33:04 2007
+++ SOURCES/ipw3945d-init       Sun Feb 25 13:27:55 2007
@@ -2,56 +2,61 @@
 #
 # Intel Pro/wireless 3945BG:   ipw3945d deamon
 #
-#chkconfig: 35 20 86
-# This is a daemon for automatically switching
+# chkconfig: 35 20 86
+# description: This is a daemon for automatically switching \
 # ipw3945d on to get access to any AP.
 #
- 
-# Source function library.
 
+# Source function library.
 . /etc/rc.d/init.d/functions
 
 DESC="Intel PRO/Wireless 3945BG"
 NAME="ipw3945d"
-RETVAL=0
 
-case "$1" in
- start)
-       if [ ! -f /var/run/ipw3945d.pid ]; then
-               msg_starting "$DESC: $NAME "
+start() {
+       if [ ! -f /var/lock/subsys/ipw3945d ]; then
+               msg_starting "$DESC: $NAME"
                /sbin/modprobe --ignore-install ipw3945
                daemon /sbin/ipw3945d --timeout=-1 --quiet
                RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipw3945d
        else
-               msg_already_running "$DESC: $NAME "
+               msg_already_running "$DESC: $NAME"
        fi
-       exit $?
-       ;;
- stop)
-       if [ -f /var/run/ipw3945d.pid ]; then
-               msg_stopping "$DESC: $NAME "
-               /sbin/ipw3945d --kill 
+}
+
+stop() {
+       if [ -f /var/lock/subsys/ipw3945d ]; then
+               msg_stopping "$DESC: $NAME"
+               /sbin/ipw3945d --kill
                /sbin/modprobe -r --ignore-remove ipw3945
-               RETVAL=$?
+               ok
+               rm -f /var/lock/subsys/ipw3945d
        else
-               msg_not_running "$DESC: $NAME "
+               msg_not_running "$DESC: $NAME"
        fi
-       exit $?
+}
+
+RETVAL=0
+case "$1" in
+ start)
+       start
        ;;
- status)
-       status /sbin/ipw3945d
-       exit $?
+ stop)
+       stop
        ;;
  restart|force-reload)
-       $0 stop
+       stop
        sleep 1
-       $0 start
+       start
+       ;;
+ status)
+       status /sbin/ipw3945d
        exit $?
-       ;;                               
+       ;;
  *)
        msg_usage "$0 {start|stop|restart|force-reload|status}"
        exit 3
 
 esac
 exit $RETVAL
-
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/ipw3945d-init?r1=1.1&r2=1.2&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to