#! /bin/sh # # ipw3945 Sets up network profile # # Author: Alberto Federico Turelli . # # Version: @(#)ipw3945 0.0.1-1 01-Apr-2006 bibe@atworkonline.it # set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="Intel PRO/Wireless 3945" NAME=ipw3945 SCRIPTNAME=/etc/init.d/$NAME # Exit if not root if [ $(id -u) -gt 0 ] then echo "This script must be run as root." exit 99 fi # Gracefully exit if the package has been removed. test -x $SCRIPTNAME || exit 0 # These lines are supposet to be put in /etc/modprobe.d/ipw3945, but at boot time the regulatory daemon doesn't start. # install ipw3945 /sbin/modprobe --ignore-install ipw3945 && sleep 0.5 && /sbin/ipw3945d --quiet # remove ipw3945 /sbin/ipw3945d --kill; /sbin/modprobe -r --ignore-remove ipw3945 # Loads the driver and starts the regulatory daemon load() { /sbin/modprobe --ignore-install ipw3945 /sbin/ipw3945d --timeout=-1 --quiet } # Unloads the driver (killing the regulatory daemon) unload() { /sbin/ipw3945d --kill 2>/dev/null /sbin/modprobe -r --ignore-remove ipw3945 } case "$1" in start|restart) echo -n "Starting $DESC: $NAME" unload sleep 0.5 load sleep 1.0 echo "." ;; stop) echo -n "Stopping $DESC: $NAME" unload echo "." ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2 exit 1 ;; esac exit 0