2002-06-13 22:14:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: devfs
|
|
|
|
# REQUIRE: LOGIN
|
2003-05-05 15:38:41 +00:00
|
|
|
# BEFORE: securelevel
|
2002-06-13 22:14:37 +00:00
|
|
|
# KEYWORD: FreeBSD
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="devfs"
|
2003-05-06 01:10:33 +00:00
|
|
|
start_cmd='read_devfs_conf'
|
|
|
|
stop_cmd=':'
|
2002-06-13 22:14:37 +00:00
|
|
|
|
2003-05-06 01:10:33 +00:00
|
|
|
read_devfs_conf()
|
|
|
|
{
|
|
|
|
if [ -r /etc/devfs.conf ]; then
|
|
|
|
cd /dev
|
|
|
|
while read action device parameter; do
|
|
|
|
case "${action}" in
|
|
|
|
l*) if [ -c ${device} -a ! -e ${parameter} ]; then
|
|
|
|
ln -fs ${device} ${parameter}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
o*) if [ -c ${device} ]; then
|
|
|
|
chown ${parameter} ${device}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
p*) if [ -c ${device} ]; then
|
|
|
|
chmod ${parameter} ${device}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done < /etc/devfs.conf
|
|
|
|
fi
|
|
|
|
}
|
2003-05-02 08:10:58 +00:00
|
|
|
|
2003-05-06 01:10:33 +00:00
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|