#!/bin/bash # # Copyright Francois Wautier 2005 # A script tp toggle the wireless adapter on Acer 5020 Series laptop # This script is provided as-is, without any warranty. # Permission is granted to use and abuse this script as # long as the original copyright is mentioned # # Interface to use interf=wlan0 # # Module to us wmodule=ndiswrapper # # isloaded=`lsmod|awk '{ print $1 }'|grep $wmodule` # acerok=`lsmod|awk '{ print $1 }'|grep acer_acpi` if [ "$acerok" == "" ]; then echo "acer_acpi not loaded. Attempting to load" /sbin/modprobe acer_acpi /sbin/modprobe acer_acpi fi acerok=`lsmod|awk '{ print $1 }'|grep acer_acpi` if [ "$acerok" == "" ]; then echo "Could not load acer_acpi. Aborting" exit fi if [ "$isloaded" == "" ]; then #Load it # Enable the radio echo "enabled : 1" >/proc/acpi/acer/wireless sleep 1 # Load the driver. Hotplug should do the rest /sbin/modprobe ndiswrapper else #/sbin/ifconfig $interf down /etc/init.d/net.$interf stop echo "enabled : 0" >/proc/acpi/acer/wireless /sbin/rmmod ndiswrapper fi