All pastes #835943 Raw Edit

Wireless

public shellscript v1 · immutable
#835943 ·published 2007-12-29 03:23 UTC
rendered paste body
#!/bin/bash#Wireless# chmod 755 Wirelessecho "Type ath0 for DWL-G650"echo "Type wlan0 for IPW3945 (Not Working)"echo -ne "Enter card interface to use: "read -e ifaceecho -n "Attempting to configure card with $iface "case "$iface" in  ath0)  ifconfig ath0 down; ifconfig ath0 up;  ;;  wlan0)  ifconfig wlan0 down; ifconfig wlan0 up;  ;;  *)  echo "Incorrect interface selected exiting...";  ;;esacif [ $iface = "" ];     then     echo "No interface selected exiting..."     exit     elif [ 1 = 1 ] ; then        echo " Attempting to connect... "        #copying correct variant to location. (Edit location to suite your needs or comment out)        cp /mnt/sdb1/wpa_supplicant.conf /etc/        #remove old dhcpcd leases to ensure fresh start.        if [ -e "/etc/dhcpc/dhcpcd-$iface.cache" ] ; then        rm /etc/dhcpc/dhcpcd-*;        fi        #Stop any wpa_supplicant that is running.        if [ -e "/var/run/wpa_supplicant/$iface" ] ; then        rm /var/run/wpa_supplicant/$iface        fi        wpa_supplicant -w -Dwext -i$iface -B -c/etc/wpa_supplicant.conf        echo "DHCP Initialized on $iface"        if [[ $iface = ath0 ]] ; then        dhcpcd ath0        elif [[ $iface = wlan0 ]] ; then        dhcpcd wlan0        fi        echo " Connection established..."        echo " Done... "        sleep 1fi