# ray16

wasted blog

# ray16 RSS Feed
 

Archive for shell script

manual connect to wlan network shell script

saya paling hobi buat konek ke wireless gak pake dhclient a.k.a manual ahaha
karena ribetnya saya akhirnya buat script shell sendiri berikut:
setelah gunakan script ini Anda tinggal pake iwconfig untuk tentukan essid karena saya bingung gak bisa input nama essid yang pake spasi :(

$ iwconfig dev essid "ESSID"

jangan lupa

$ chmod +x wlan

download script disini -> [download id=”13″]

clear
echo "#########################################################################
#       .______                .___                          ._______   #
#     __| _ __/ __________   __| _/ ___________   ______  _  |___   /   #
#    / __ |\  \/  /\_  __ \ / __ |_/ ___\_  __ \_/ __ \ \/ \/ / /  /    #
#   / /_/ |/  /\  \_|  | \// /_/ |\  \___|  | \/\  ___/\     / / _/___  #
#   \____ /__/  \__  >_|   \____ | \___  >__|    \___  >\/\_/ /_____  | #
#   /--_| |        \/      /--_| |     \/            \/             \/  #
#   \____ |                \____ |         shell script                 #
#       \/                     \/        manual connect to network      #
# after use this script just add manual ur essid			#
# by use iwconfig essid "ESSID"						#
#########################################################################"
echo "input device?"
read dev
echo "-> getting down $dev";ifconfig $dev down
echo "-> changing mac address";macchanger -r $dev
echo "-> waking up $dev";ifconfig $dev up
echo "-> flushing all ip from $dev";ip address flush dev $dev
echo "-> flushing all routing table from $dev";ip route flush dev $dev
echo "input wep key?"
read wep
echo "input rate? 11M or 18M or 24M"
read rate
echo "-> set key and rate to $dev";iwconfig $dev key $wep rate $rate
$show iwconfig $dev
echo "input ip?"
read ip
echo "-> adding ip table for $dev";ip route add dev $dev
echo "input broadcast? default: xxx.xxx.xxx.255"
read bcast
echo "-> changing $dev ip to $ip and $dev broadcast to $bcast";ip address add $ip broadcast $bcast dev $dev
$show ;ip address show dev $dev
echo "input netmask?"
read netmask
echo "-> changing $dev netmask to $netmask";ifconfig $dev netmask $netmask
$show ;ifconfig $dev
echo "input gateway ip?"
read gateway
echo "-> adding $gateway to default gateway";route add default gw $gateway
echo "# if no probs, now get your wlan to point to ur essid"
echo "# ray16 [ @ ] gxrg.org"
echo "# ray16.info"
exit 0

Good Luck!