~ubuntu-branches/ubuntu/hardy/linux-backports-modules-2.6.24/hardy-security

« back to all changes in this revision

Viewing changes to updates/wireless/iwlwifi/iwlwifi/unload

  • Committer: Bazaar Package Importer
  • Author(s): , Ben Collins
  • Date: 2008-04-02 06:59:04 UTC
  • Revision ID: james.westby@ubuntu.com-20080402065904-e5knh2gn2hms3xbb
Tags: 2.6.24-14.11
[Ben Collins]

* iwlwifi: Update to iwlwifi-1.2.25 and mac80211-10.0.4
  - LP: #200950
* ubuntu: Slight cleanups to module hiearchy and Makefiles
* mac80211: Enable LED triggers
* iwlwifi: Add LED trigger support (rx and tx only)
  - LP: #176090

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
if [ $# == 0 ]; then
 
3
        module=$(lsmod | sed -ne 's,^iwl\([^[:space:]]*\).*,iwl\1,p')
 
4
        module=${module//_/-}
 
5
else    
 
6
        module=$@
 
7
fi
 
8
 
 
9
function check_root()
 
10
{
 
11
        [ $(whoami) != "root" ] && 
 
12
                echo "You must be root to run this script." &&
 
13
                return 1
 
14
 
 
15
        return 0
 
16
}
 
17
 
 
18
function unload()
 
19
{
 
20
        unset UNLOADED
 
21
        [ -d compatible ] && dir=compatible || dir=origin
 
22
        for i in ${module} mac80211 cfg80211; do
 
23
                if lsmod | grep -q ${i/-/.}; then
 
24
                        UNLOADED="${UNLOADED}${i} "
 
25
                        rmmod "$dir/$i"
 
26
                fi
 
27
        done
 
28
        if [ -z "${UNLOADED}" ]; then
 
29
                echo "No modules unloaded."
 
30
        else
 
31
                echo "Unloaded: $UNLOADED"
 
32
        fi
 
33
}
 
34
 
 
35
check_root && unload