* Moved update-rc to /usr/sbin * init-functions now exports container variable * init.d scripts should now act appropriately in containers * Removed localnet init script - should be performed by iftools init * Added REPO to Makefile
53 lines
1.1 KiB
Bash
Executable File
53 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: modules
|
|
# Required-Start: mountvirtfs sysctl
|
|
# Required-Stop:
|
|
# Should-Start:
|
|
# Should-Stop:
|
|
# Default-Start: S
|
|
# Default-Stop:
|
|
# Short-Description: Load modules listed in /etc/modules.conf
|
|
# X-Required: true
|
|
### END INIT INFO
|
|
|
|
CONF=/etc/modules.conf
|
|
|
|
[ -r $CONF ] || exit 0
|
|
[ -e /proc/modules ] || exit 0
|
|
[ -z $container ] || exit 0
|
|
egrep -qv '^(\s*#|$)' $CONF || exit 0
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
isloaded () {
|
|
grep -q "^$1 " /proc/modules
|
|
return $?
|
|
}
|
|
|
|
case "$1" in
|
|
start|restart)
|
|
log_init_msg "Loading modules"
|
|
|
|
while read module args; do
|
|
echo $module | egrep -qv '^(\s*#|$)' || continue
|
|
modprobe -q ${module} ${args} || failed=1
|
|
done < $CONF
|
|
|
|
[ -z $failed ] && log_success_msg || log_failure_msg
|
|
;;
|
|
status)
|
|
while read module args; do
|
|
echo $module | egrep -qv '^(\s*#|$)' || continue
|
|
log_init_msg "Checking $module"
|
|
isloaded $module && log_success_msg || log_failure_msg
|
|
done < $CONF
|
|
;;
|
|
*)
|
|
echo "Usage: $0 [start|restart|status]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|