Advertisement
noes1s

WiFiX 11.10

Nov 3rd, 2011
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.25 KB | None | 0 0
  1. #!/bin/bash
  2. #  ,___     r2
  3. #  ¡  _`    wifix
  4. #  ª_/()    http://pastebin.com/u/noes1s
  5. #  |\` `,   CC BY-SA 3.0
  6. # _·'   l  
  7. #___________________________________________________________________________________________________
  8.  
  9. #Dependencies: sed, wget, patch
  10.  
  11. #Variables:
  12. ddir=$(pwd)
  13. kernel=$(uname -r |sed -e 's/-.*//')
  14.  
  15. InstallCompat(){
  16.     bl='/etc/modprobe.d/blacklist.conf'
  17.     blacklist=(wl)
  18.     for d in ${blacklist[*]}; { [[ $(cat $bl | grep $d) ]]|| echo blacklist $d | tee -a $bl ;}
  19.  
  20.     wget http://patches.aircrack-ng.org/channel-negative-one-maxim.patch -O- | patch -Np1
  21.     wget http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch -O- | patch -Np1
  22.     wget http://patches.aircrack-ng.org/zd1211rw-inject+dbi-fix-2.6.26.patch -O- | patch -Np0
  23.     wget http://patches.aircrack-ng.org/mac80211_2.6.32.2-wl_frag+ack_radiotap.patch -O- | patch -Np1
  24.    
  25.     make && make install && {
  26.  
  27.     MODULES=(
  28.     iwlwifi_mac80211 rc80211_simple zd1211rw-mac80211
  29.     ieee80211_crypt_tkip ieee80211_crypt_ccmp
  30.     ieee80211softmac ieee80211_crypt ieee80211
  31.     bcm43xx rndis_wext iwl4965
  32.     ipw2100 ipw2200 libipw
  33.     wl1251 wl12xx iwmc3200wifi
  34.     libertas_cs usb8xxx libertas libertas_sdio libertas_spi
  35.     libertas_tf libertas_tf_usb
  36.     adm8211 zd1211rw
  37.     orinoco_cs orinoco_nortel orinoco_pci orinoco_plx
  38.     orinoco_tld orinoco_usb spectrum_cs orinoco
  39.     b43 b44 b43legacy brcm80211 ssb
  40.     iwl3945 iwlagn iwlcore
  41.     ath9k ath9k_htc ath9k_common ath9k_hw
  42.     ath5k ath ath6kl ar9170usb carl9170
  43.     p54pci p54usb p54spi p54common
  44.     rt2400pci rt2500pci rt61pci
  45.     rt2500usb rt73usb
  46.     rt2800usb rt2800lib
  47.     rt2x00usb rt2x00lib
  48.     rtl8180 rtl8187 rtl8192ce rtlwifi
  49.     mwl8k mac80211_hwsim
  50.     at76c50x_usb at76_usb
  51.     rndis_wlan rndis_host cdc_ether usbnet
  52.     eeprom_93cx6
  53.     lib80211_crypt_ccmp lib80211_crypt_tkip lib80211_crypt_wep
  54.     mac80211 cfg80211 lib80211
  55.     )
  56.    
  57.     IPW3945D="/sbin/ipw3945d-`uname -r`"
  58.     if [ -f $IPW3945D ]; then
  59.         $IPW3945D --isrunning
  60.         if [ ! $? ]; then
  61.             echo -n " Detected ipw3945 daemon loaded we're going to "
  62.             echo -e " shut the daemon down now and remove the module."
  63.             modprobe -r --ignore-remove ipw3945
  64.         fi
  65.     fi
  66.  
  67.     grep ath_pci /proc/modules 2>&1 > /dev/null
  68.     if [ $? -eq 0 ]; then
  69.         echo -e "\n MadWifi driver is loaded, going to try to unload it..."
  70.         ./scripts/madwifi-unload
  71.     fi
  72.  
  73.     for i in ${MODULES[*]}; do
  74.         grep ^$i /proc/modules > /dev/null
  75.         if [ $? -eq 0 ]; then
  76.             echo -e "\n Restarting $i module(s)..." && mod=$i
  77.             modprobe -r --ignore-remove $i
  78.         fi 
  79.     done
  80.  
  81.     ! grep ^$i /proc/modules > /dev/null && modprobe $mod &&
  82.         echo -e "\n\e[1;32m Ready! \e[m"
  83.         echo -e " Drivers not working? -> Reboot your system.\n" ;} ||
  84.     echo -e '\n\e[1;31m (!) Unknown installation error\e[m\n'
  85.     cd $ddir
  86. }
  87.  
  88. Compat(){
  89.     cd /tmp
  90.     #Kernel 3.0
  91.     if [[ $(echo $kernel |cut -c1-3) = 3.0 ]]; then
  92.         link="http://www.orbit-lab.org/kernel/compat-wireless-3.0-stable/v$kernel/"
  93.     #Kernel 2.6
  94.     elif [[ $(echo $kernel |cut -c1-3) = 2.6 ]]; then
  95.         link="http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v$kernel/"
  96.     fi        
  97.     package=$(wget -qO- $link | awk '/tar.bz2/{print $6}' | sed -e '$!d;s/.*="//;s/".*//')
  98.     dir=$(echo $package | sed 's/*//;s/.tar.bz2.*//')
  99.     [[ -e $package ]] && rm $package
  100.     [[ -d $dir ]] && rm -rf $dir
  101.     wget $link/$package -O- | tar xvj && cd ./$dir && InstallCompat
  102. }
  103.  
  104. Welcome(){
  105.     clear
  106.     echo -e "\e[1;31mwi\e[32mfix\e[m"
  107. }
  108.  
  109. Help(){
  110.     Welcome
  111.     echo -e " Use: $0 [option]\n
  112. -i : Compat    (Install Compat-wireless stable drivers)
  113. -h : Help
  114. Dependencies: sed, wget, patch
  115. Internet connection required!\n"
  116. }
  117.  
  118. #___________________________________________________________________________________________________
  119. # STARTUP
  120. #___________________________________________________________________________________________________
  121. Welcome && ((UID)) && echo -e "\n\e[1;31m"' (!) '"\e[mUse: sudo bash $0\n" && exit
  122.  
  123. while getopts "i" execute; do
  124.    case ${execute} in
  125.       i ) Compat; exit;;
  126.       * ) Help; exit ;;
  127.    esac
  128. done
  129. Welcome
  130. select opt in Compat Help; { $opt; exit ;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement