irenicus09

Atheros Card Quick Fix

Jul 31st, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.63 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. #
  4. # This script was coded to optimise internal Atheros Wireless Network Adapter
  5. #
  6. # Author  : irenicus09
  7. # Date    : 1/8/2015
  8. # License : GPLv3
  9. #
  10. ############################################################################################
  11.  
  12. if [ $# -ne 1 ]
  13. then
  14.         echo "Automated Wireless Optimiser";
  15.         echo "Usage: $0 [interface]";
  16.         exit 1;
  17. fi
  18.  
  19. interface=$1;
  20.  
  21. # Change driver as appropriate for your card, default driver for Atheros AR9485: ath9k
  22. driver="ath9k";
  23.  
  24. #=============================================================================
  25. echo ""
  26. echo "==================================================================="
  27. echo "      Welcome to Automated Wireless Optimiser";
  28. echo "==================================================================="
  29. sleep 1;
  30.  
  31. echo "[+] Stopping Network Manager... ";
  32. systemctl stop NetworkManager.service; #1>/dev/null;
  33. wait;
  34. pkill NetworkManager;
  35.  
  36. # Disabling RFKILL on Wifi
  37. rfkill unblock wifi all;
  38.  
  39. # Reloading modules from kernel
  40. echo "[+] Reloading modules";
  41. rmmod $driver;
  42. modprobe $driver;
  43.  
  44.  
  45. echo "[+] Taking down your card offline";
  46. ifconfig $interface down;
  47.  
  48.  
  49. echo "[+] Changing mac-address";
  50. macchanger -r $interface;
  51.  
  52. iwconfig $interface mode managed;
  53. iwconfig $interface power off;
  54.  
  55. echo "[+] Bringing up wireless card online";
  56. ifconfig $interface up;
  57.  
  58. echo "[+] Starting Network Manager... ";
  59. systemctl start NetworkManager.service; #1>/dev/null;
  60. wait;
  61. NetworkManager;
  62. sleep 1;
  63.  
  64. echo "[+] All patched up and done, have a nice day! ;)";
  65. echo "===================================================================\n"
  66.  
  67. exit 0;
Advertisement
Add Comment
Please, Sign In to add comment