2018-03-04 18:10:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Assure that the kernel has module support.
|
|
|
|
[ -e /proc/ksyms -o -e /proc/modules ] || exit 0
|
|
|
|
|
|
|
|
THIS=$(basename $0)
|
|
|
|
|
|
|
|
case "${1}" in
|
|
|
|
start)
|
|
|
|
|
|
|
|
# Exit if there's no modules file or there are no
|
|
|
|
# valid entries
|
|
|
|
if [ -r /etc/sysconfig/modules ]; then
|
|
|
|
egrep -qv '^($|#)' /etc/sysconfig/modules
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Only try to load modules if the user has actually given us
|
|
|
|
# some modules to load.
|
|
|
|
while read MODULE ARGS; do
|
|
|
|
|
|
|
|
# Ignore comments and blank lines.
|
|
|
|
case "$MODULE" in
|
|
|
|
""|"#"*) continue ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Attempt to load the module, making
|
|
|
|
# sure to pass any arguments provided.
|
|
|
|
modprobe ${MODULE} ${ARGS} >/dev/null
|
|
|
|
|
|
|
|
# Print the module name if successful,
|
|
|
|
# otherwise take note.
|
|
|
|
if [ $? -eq 0 ]; then
|
2020-05-09 22:49:37 +01:00
|
|
|
echo "Loading module ${MODULE}: OK"
|
2018-03-04 18:10:30 +00:00
|
|
|
else
|
2020-05-09 22:49:37 +01:00
|
|
|
echo "Loading module ${MODULE}: ERROR"
|
2018-03-04 18:10:30 +00:00
|
|
|
fi
|
|
|
|
done < /etc/sysconfig/modules
|
|
|
|
;;
|
2020-05-09 22:49:37 +01:00
|
|
|
stop)
|
|
|
|
;;
|
2018-03-04 18:10:30 +00:00
|
|
|
*)
|
2020-05-09 22:49:37 +01:00
|
|
|
echo "Usage: ${0} {start|stop}"
|
2018-03-04 18:10:30 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|