]> git.pld-linux.org Git - packages/em8300.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 16 Mar 2007 18:26:41 +0000 (18:26 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    em8300.init -> 1.9

em8300.init

index 5dbb4b3e04fc79e5319fb7c71caa01f23788ac15..3235dbc187f7a24828ccd37f4f0e25ca971e63db 100644 (file)
@@ -12,25 +12,32 @@ fi
 
 . /etc/sysconfig/em8300
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start|reload|force-reload)
+start() {
        is_yes "$BT_LOAD" && _modprobe single bt865 $BT_OPT
        _modprobe single adv717x $ADV_OPT
        _modprobe single em8300 $EM_OPT
        run_cmd "Uploading em8300 microcode" "sh -c 'em8300setup 2>/dev/null'"
        [ $? -ne 0 ] && RETVAL=1
+}
+
+stop() {
+       run_cmd "Removing em8300 modules" "sh -c 'rmmod em8300 adv717x bt865 2>/dev/null'"
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start|reload|force-reload)
+       start
        ;;
   stop)
-       run_cmd "Removing em8300 modules" "sh -c 'rmmod em8300 adv717x bt865 2>/dev/null'"
+       stop
        ;;
   status)
        ;;
   restart)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
This page took 0.109434 seconds and 4 git commands to generate.