Linux-libre 2.6.34.11-gnu1
[librecmc/linux-libre.git] / drivers / staging / dt3155 / dt3155.sysvinit
1 #! /bin/sh
2 #
3 # Module load/unload script for use with SysV-style /etc/init.d/ systems.
4 # On a Debian system, copy this to /etc/init.d/dt3155 and then run
5 #       /usr/sbin/update-rc.d dt3155 defaults 55
6 # to create the appropriate /etc/rc?.d/[SK]55dt3155 start/stop links.
7 # (The "55" is arbitrary but is what I use to load this rather late.)
8 #
9 #    Andy Dougherty   Feb 22 2000       doughera@lafayette.edu
10 #    Dept. of Physics
11 #    Lafayette College, Easton PA 18042
12 #
13
14 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15
16 # Edit to point to your local copy.
17 FILE=/usr/local/lib/modules/dt3155/dt3155.o
18 NAME="dt3155"
19 DESC="dt3155 Frame Grabber module"
20 DEV="dt3155"
21
22 if test ! -f $FILE; then
23     echo "Unable to locate $FILE"
24     exit 0
25 fi
26
27 set -e
28
29 case "$1" in
30   start)
31     echo -n "Loading $DESC "
32     if /sbin/insmod -v -f $FILE; then
33         major=`grep $DEV /proc/devices | awk "{print \\$1}"`
34         rm -f /dev/dt3155?
35         mknod /dev/dt3155a c $major 0
36         mknod /dev/dt3155b c $major 1
37         chmod go+rw /dev/dt3155?
38         echo
39     else
40         echo "$FILE not loaded."
41     fi
42     ;;
43   stop)
44     echo -n "Unloading $DESC: "
45     if /sbin/rmmod $NAME ; then
46         echo
47     else
48         echo "$DEV not removed"
49         exit 0
50     fi
51     rm -f /dev/dt3155?
52     ;;
53   *)
54     echo "Usage: /etc/init.d/$NAME {start|stop}"
55     exit 1
56     ;;
57 esac
58
59 exit 0
60