#!/bin/sh
### BEGIN INIT INFO
# Provides: wireless
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop: 0 6
# Short-Description: unload wifi modules
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
case "$1" in
start)
# do nothing at start
;;
stop)
log_daemon_msg "Removing wifi modules from kernel"
/usr/local/sbin/wireless-stop.sh
;;
restart|force-reload)
# do nothing at restart and reload
;;
status)
# no mean to ask for a status.
;;
*)
echo "Usage: /etc/init.d/wireless stop"
exit 1
;;
esac
then, just symlink in /etc/rc0.d (shutdown) and /etc/rc6.d (restart):
# cd /etc/rc0.d && ln -s /etc/init.d/wireless K00wireless
# cd /etc/rc6.d && ln -s /etc/init.d/wireless K00wireless
SOLVED.
Starting from your suggestion, having I a rtl8723be based wifi card, I made a simple test:
$ sudo su
# service network-manager stop
# modprobe -r rtl8723be
# modprobe -r rtl8723_common rtl_pci
# modprobe -r rtlwifi
# killall -9 wpa_supplicant
then shutdown: the system halted perfectly. I retryed several time, and always worked.
So, simply, I made a script in /usr/local/ sbin/wireless- stop.sh:
#!/bin/bash
service network-manager stop
modprobe -r rtl8723be
modprobe -r rtl8723_common rtl_pci
modprobe -r rtlwifi
killall -9 wpa_supplicant
then an entry in /etc/init. d/wireless:
#!/bin/sh /bin:/usr/ sbin:/usr/ bin local/sbin/ wireless- stop.sh force-reload) d/wireless stop"
### BEGIN INIT INFO
# Provides: wireless
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop: 0 6
# Short-Description: unload wifi modules
### END INIT INFO
PATH=/sbin:
case "$1" in
start)
# do nothing at start
;;
stop)
log_daemon_msg "Removing wifi modules from kernel"
/usr/
;;
restart|
# do nothing at restart and reload
;;
status)
# no mean to ask for a status.
;;
*)
echo "Usage: /etc/init.
exit 1
;;
esac
then, just symlink in /etc/rc0.d (shutdown) and /etc/rc6.d (restart):
# cd /etc/rc0.d && ln -s /etc/init. d/wireless K00wireless d/wireless K00wireless
# cd /etc/rc6.d && ln -s /etc/init.
et voilĂ . Shutdown and restart now works.