-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathmodules.sh
More file actions
executable file
·29 lines (22 loc) · 681 Bytes
/
Copy pathmodules.sh
File metadata and controls
executable file
·29 lines (22 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
MODULES=/etc/modules
# Check that the kernel has module support.
[ -e /proc/ksyms -o -e /proc/modules ] || exit 0
case "${1}" in
start)
# Exit if there's no modules file or there are no valid entries
[ -r ${MODULES} ] && grep -Eqv '^($|#)' ${MODULES} || exit 0
while read module args; do
# Ignore comments and blank lines.
case "$module" in
""|"#"*) continue ;;
esac
# Try to load the module with its arguments
modprobe ${module} ${args} > /dev/null
done < ${MODULES}
;;
*)
echo "Usage: ${0} {start}"
exit 1
;;
esac