2010-09-30 14:57:53 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2019-06-19 18:42:57 +02:00
|
|
|
# Run the mdev daemon
|
2010-09-30 14:57:53 +02:00
|
|
|
#
|
|
|
|
|
2019-06-19 18:42:57 +02:00
|
|
|
DAEMON="mdev"
|
|
|
|
PIDFILE="/var/run/$DAEMON.pid"
|
|
|
|
|
2019-06-19 18:42:56 +02:00
|
|
|
|
|
|
|
start() {
|
2019-06-19 18:42:57 +02:00
|
|
|
echo -n "Starting $DAEMON... "
|
|
|
|
start-stop-daemon -S -b -m -p $PIDFILE -x /sbin/mdev -- -df
|
|
|
|
[ $? -eq 0 ] && echo "OK" || echo "ERROR"
|
|
|
|
|
2016-03-09 00:03:25 +01:00
|
|
|
# coldplug modules
|
2019-06-19 18:42:56 +02:00
|
|
|
find /sys/ -name modalias -print0 | \
|
|
|
|
xargs -0 sort -u | \
|
|
|
|
tr '\n' '\0' | \
|
|
|
|
xargs -0 modprobe -abq
|
|
|
|
}
|
|
|
|
|
2019-06-19 18:42:57 +02:00
|
|
|
stop() {
|
|
|
|
echo -n "Stopping $DAEMON... "
|
|
|
|
start-stop-daemon -K -p $PIDFILE
|
|
|
|
[ $? -eq 0 ] && echo "OK" || echo "ERROR"
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
}
|
|
|
|
|
2019-06-19 18:42:56 +02:00
|
|
|
case "$1" in
|
2019-06-19 18:42:57 +02:00
|
|
|
start|stop|restart)
|
2019-06-19 18:42:56 +02:00
|
|
|
"$1"
|
2010-09-30 14:57:53 +02:00
|
|
|
;;
|
|
|
|
*)
|
2019-06-19 18:42:57 +02:00
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
2010-09-30 14:57:53 +02:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|