
#!/bin/sh
# Description: Load proprietary Broadcom wireless driver at boot.
BLACKLIST=$(grep -E 'blacklist b43'   /etc/modprobe.d/blacklist.conf)

case "$1" in
        start)
                [ ! "$BLACKLIST" ] && echo blacklist b43 >> /etc/modprobe.d/blacklist.conf
                rmmod b43
                rmmod wl
                rmmod ssb
                modprobe wl
                ;;

        stop)
                sed -i '/blacklist\ b43$/d' /etc/modprobe.d/blacklist.conf
                echo -n "Nothing to stop"
                ;;
        
        restart)
                echo -n "Nothing to restart"
                ;;
         
        status)
                lsmod | grep -q "^wl " && echo "BC-wl is running." || echo "BC-wl is stopped."
                ;;                
 
esac
unset BLACKLIST

