Viitor_upstart/etc/init/unloadmodules.conf
kueller fb2d38cb57 Zusätzliche Scripte für den Systemshutdown unter upstart
git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_upstart@5507 504e572c-2e33-0410-9681-be2bf7408885
2010-04-20 12:59:43 +00:00

29 lines
536 B
Plaintext

description "Unload all Kernel Modules"
author "Harald Kueller <harald.kueller@compuextreme.de>"
version 1.0
emits none special
start on stopping udev
script
if [ -f /etc/sysconfig/loadmods ]; then
Z=0
while [ "$Z" "<" "9" ]; do
exec 3</proc/modules
while read <&3 MODNAME INFO; do
if rmmod -s $MODNAME &>/dev/null; then
print_status success
else
if [ "$Z" == "8" ]; then
print_status failure
else
echo "failed"
fi
fi
done
(( Z = $Z + 1 ))
exec 3>&-
done
fi
end script