#! /bin/sh

start() {
    echo -n "Starting wireless... "
    pidof wireless
    if [ "$?" == 0 ]; then
        killall wireless
    fi
    /binary/wlconfig
    /binary/wireless &
    echo "done"
}

stop() {
    echo -n "Stopping wireless..."
    killall wireless
    echo "done"
}

restart() {
    stop
    start
}

# See how we were called.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart|reload)
        restart
        ;;
    *)
        echo "Usage: $0 {start|stop|reload|restart}"
        exit 1
esac

exit $?
