d1d01cf0f6750e8542a40e3c1ce69967eb81f409
[debian/makedev] / debian / init.d
1 #! /bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides:             makedev
5 # Required-Start:       $local_fs
6 # Required-Stop:        $local_fs
7 # Default-Start:        2 3 4 5
8 # Default-Stop:         0 1 6
9 # Short-Description:    Creates device files in /dev
10 ### END INIT INFO
11
12 N=/etc/init.d/makedev
13 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
14
15 set -e
16
17 case "$1" in
18   start)
19         test -L /dev/MAKEDEV || ln -fs /sbin/MAKEDEV /dev/MAKEDEV
20
21         # create dvb-devices, if the dvb-directory allready exists, and 
22         # no devfs or udev is in use (workaround for the changed major-number
23         # of the dvb-devices, introduced in kernel 2.6.8, to be able to 
24         # switch between kernels <= 2.6.7 and >= 2.6.8, without manual 
25         # recreation of the devices (MAKEDEV dvb checks the kernel-version 
26         # and uses the correct major-number))
27         
28         if [ ! -e /dev/.devfsd -a ! -e /dev/.udevdb -a ! -e /dev/.udev ]; then
29                 if [ -d /dev/dvb ]; then
30                         cd /dev && ./MAKEDEV dvb
31                 fi
32         fi
33         
34         ;;
35   stop|reload|restart|force-reload)
36         ;;
37   *)
38         echo "Usage: $N {start|stop|restart|force-reload}" >&2
39         exit 1
40         ;;
41 esac
42
43 exit 0