Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

Stuff
Sunday, March 18th, 2007 at 2:36:44am UTC 

  1. #ndiswrapper_setup - designed to set up your bcm4318 wireless card
  2. #Copyright (C) 2006 Jesse N. Richardson
  3. #
  4. #This program is free software; you can redistribute it and/or
  5. #modify it under the terms of the GNU General Public License
  6. #as published by the Free Software Foundation; either version 2
  7. #of the License, or (at your option) any later version.
  8. #
  9. #This program is distributed in the hope that it will be useful,
  10. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. #GNU General Public License for more details.
  13. #
  14. #You should have received a copy of the GNU General Public License
  15. #along with this program; if not, write to the Free Software
  16. #Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  17.  
  18.  
  19. #!/bin/bash
  20.  
  21.  
  22. ckreboot()
  23. {
  24. echo "Do you want to reboot now? y/n: "
  25. read rb
  26.  
  27. if [[ $rb == "y" || $rb == "yes" ]]; then
  28.         echo "rebooting..."
  29.         sudo reboot
  30. else
  31.         exit
  32. fi
  33. }
  34.  
  35. install()
  36. {
  37. echo "ndiswrapper_setup, Copyright (C) 2006 Jesse N. Richardson
  38. ndiswrapper_setup comes with ABSOLUTELY NO WARRANTY; for details
  39. type please see the file gpl.txt in the same directory as this program.
  40. This is free software, and you are welcome  to redistribute it
  41. under certain conditions; type see the file gpl.txt in the same directory
  42. as this program for details."
  43. echo "Installing ndiswrapper..."
  44. logsave -a wifisetup.log dpkg -i ndiswrapper.deb
  45. echo "Extracting the drivers..."
  46. tar -xf wifidrivers.tar.gz
  47. echo "Deleting temporary files..."
  48. rm wifidrivers.tar.gz
  49. echo "Changing driver permissions..."
  50. chmod 777 drivers
  51. chmod 777 ndiswrapper.deb
  52. echo "Changing working directory..."
  53. cd drivers
  54. echo "Removing previous attempts to use ndiswrapper, if any...please ignore errors in this section..."
  55. logsave -a wifisetup.log rmmod ndiswrapper
  56. logsave -a wifisetup.log ndiswrapper -e bcmwl5a
  57. logsave -a wifisetup.log ndiswrapper -e bcmwl5
  58. echo "Removing default driver..."
  59. logsave -a wifisetup.log rmmod bcm43xx
  60. echo "Installing driver through ndiswrapper..."
  61. logsave -a wifisetup.log ndiswrapper -i ./bcmwl5.inf
  62. logsave -a wifisetup.log ndiswrapper -l
  63. logsave -a wifisetup.log ndiswrapper -m
  64. echo "Modprobing ndiswrapper..."
  65. logsave -a wifisetup.log modprobe ndiswrapper
  66. echo "Moving back to original working directory..."
  67. cd ..
  68. echo "Deleting more temporary files..."
  69. rm -rf drivers
  70. rm ndiswrapper.deb
  71. echo "Blacklisting bcm43xx..."
  72. echo "# knock out the default broadcom driver that doesn't work for bcm4318 wifi cards..." >> /etc/modprobe.d/blacklist
  73. echo "blacklist bcm43xx" >> /etc/modprobe.d/blacklist
  74. echo "Adding ndiswrapper to /etc/modules, so it should load on boot..."
  75. echo "ndiswrapper" >> /etc/modules
  76. echo "Removing excess entries from your network interfaces file..."
  77. cat /etc/network/interfaces | grep " lo" >> /etc/network/interfaces_new
  78. mv /etc/network/interfaces /etc/network/interfaces.backup.bcm4318_setup
  79. mv /etc/network/interfaces_new /etc/network/interfaces
  80. echo "Searching for a wifi point..."
  81. logsave -a wifi-setup.log iwlist eth1 scan
  82. logsave -a wifi-setup.log dhclient
  83. echo "Hopefully connected, you should be able to use the internet now..."
  84. echo "Installing network-manager-gnome via apt-get, this requires an internet connection..."
  85. logsave -a wifisetup.log apt-get --assume-yes install network-manger-gnome
  86. echo "Installation completed."
  87. rm ndiswrapper_setup
  88. }
  89.  
  90.  
  91. echo "This is the log of the ndiswrapper-setup script. See below for log details." >> wifisetup.log
  92.  
  93. if lspci -v | grep "BCM4318"; then
  94.         install
  95.         ckreboot
  96. else
  97.         echo "You don't seem to have a Broadcom Wireless card. Pass the option --force to install anyways, but that's probably a bad idea."
  98. fi
  99.  
  100. if [[ $1 == "--force" ]]; then
  101.         echo "--force option detected, forcing install." >> wifisetup.log
  102.         install
  103.         ckreboot
  104. fi
  105.  
  106. exit

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right