[orca-list] OT, WIFI help needed



Hi everyone
I'm looking for some assistance with trying to connect with WIFI.
I can connect to my router with only a cable.
I have Ubuntu 7.10 on an Averatec 2300.
I found a support page for Ubuntu on the Averatec laptops, and I found a 
script that should help me connect to a network.
But when I run it, I get the error:
command not found:
I will post the script below.
Thanks for any help.
I copied it from the web page, and pasted it into notepad, and transfered it 
to the home folder on my laptop, and ran it...

#!/usr/bin/perl

#    Wifi Connection Script for Averatec 2300-series (RT73) Wireless
#    Find and connect to WPA/WEP-enabled wireless networks.
#
#    Copyright (C) 2007 - Lawrie Morey lmorey+rtavwifi @ gmail.com
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

$ralink = mcp51; # replace with name of your adapter if it is not rausb0
$count = -1;

print "Averatec 2300-series Wifi Script";
print "\n--------------------------------------\n";

# scan for networks
open(SCAN, "iwpriv $ralink get_site_survey |");
   while (<SCAN>) {
   if ($count >= 1) {
      ($channel,$rssi,$ssid,$bssid,$enc,$auth,$type) = split;
      if ( $ssid ne "" ) {
      print "${count}: SSID: ${ssid}, Security: ${auth} (${enc})\n";
      }
   }
 $count += 1;
   }
close(SCAN);

# make your choice!
print "\n--------------------------------------\n";
print "Enter number of network to connect to: ";
chomp($choice = <STDIN>);
$count = -1;

# scan again and connect!
open(SCAN, "iwpriv $ralink get_site_survey |");
   while (<SCAN>) {
   if ($count == $choice) {
      ($channel,$rssi,$ssid,$bssid,$enc,$auth,$type) = split;
      print "Connecting to SSID: ${ssid}\n";

 if ($auth eq "WPA-PSK") {
  print "Enter passphrase: ";
  chomp($key = <STDIN>);
  `iwconfig $ralink essid $ssid`;
  `iwpriv $ralink set NetworkType=$type`;
  `iwpriv $ralink set AuthMode=WPAPSK`;
  `iwpriv $ralink set EncrypType=$enc`;
  `iwpriv $ralink set SSID=$ssid`;
  `iwpriv $ralink set WPAPSK=$key`;
  `iwpriv $ralink set SSID=$ssid`;
  `dhclient $ralink`;
  }
 elsif ($enc eq"WEP") {
  print "Enter key: ";
  chomp($key = <STDIN>);
  `iwconfig $ralink essid $ssid`;
  `iwconfig $ralink channel $channel`;
  `iwpriv $ralink set AuthMode=WEPAUTO`;
  `iwpriv $ralink set EncrypType=$enc`;
  `iwpriv $ralink set Key1=$key`;
  `iwpriv $ralink set SSID=$ssid`;
  `dhclient $ralink`;
 }
 else {
  print "Cannot connect to network.\n"
 }

   }
 $count += 1;
   }
close(SCAN); 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]