Go Back   Champions of Regnum > Español > La Taberna

La Taberna Un lugar para conversar sobre casi cualquier tema

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 11-15-2007, 10:37 AM   #1
sunos
Count
 
sunos's Avatar
 
Join Date: Jan 2007
Location: Rosario
Posts: 1,440
sunos has a spectacular aura aboutsunos has a spectacular aura about
Default Cual es el Script o codigo mas desatroso que hiciste?

bue, esa pregunta?
por problemas con el wifi-radar dije
Ja vamos a hacer un scriptcito de shell que me solucione la vida y termine con este mamrracho (conste que anda :-P o creo :-S todavia no lo probe)

Code:
echo "es una red WEP?"
read R2
echo "quiere usar una red guardada?(s/n)"
read R1
clear
if [ $R1 = "n" ]; then 
	echo "Ingrese la red a la que se quiere conectar (nombre completo)"
	read CON
	echo "Ingrese la clave"
	read CLAVE
	echo "Desea Guardar esta red para Futuro? (ingrse s/n)"
	read RESP
	clear
if [ $RESP = "s" ]; then
	echo "Ingrese nombre a guardar"
	read NOM 
	echo $CON > /redes/$NOM"nom"
	echo $CLAVE >> /redes/$NOM"cla"
	echo $NOM >> /redes/Guardadas.txt
	clear
fi 
elif [ $R1="s" ] ; then 
	echo "Desea ver las redes que guardo?"
	read MAMA
	clear
	if [ $MAMA = s ]; then
	cat /redes/Guardadas.txt
	else
	echo "OK"
	fi
	echo "ingrese el nombre de la red a conectar"
	read NOM
	CON=`cat /redes/$NOM"nom"`
	CLAVE=`cat /redes/$NOM"cla"`
fi
echo "Desea conectar ahora? (s/n)"
read RE
if [ $RE = s ] ; then
if [ $R2 = s ] ; then
	/sbin/iwconfig wlan0 key $CLAVE essid $CON
	dhclient wlan0
clear
else 
echo "# See /usr/doc/wpa_supplicant-0.5.7/wpa_supplicant.conf.sample
# for many more options that you can use in this file.

# This line enables the use of wpa_cli which is used by rc.wireless
# if possible (to check for successful association)
ctrl_interface=/var/run/wpa_supplicant
# By default, only root (group 0) may use wpa_cli
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

# WPA protected network, supply your own ESSID and WPAPSK here:
network={
  scan_ssid=0
  ssid=\"$CON\"
  proto=WPA
  key_mgmt=WPA-PSK
  pairwise=CCMP TKIP
  group=CCMP TKIP WEP104 WEP40
  psk=\"$CLAVE\"
}

# Plaintext connection (no WPA, no IEEE 802.1X),
# nice for hotel/airport types of WiFi network.
# Youll need a recent version of wireless-tools for this!
network={
  ssid=\"any\"
  key_mgmt=NONE
  priority=2
}" > /redes/wpa_supplicant.conf
	wpa_supplicant -w ext -i wlan0 -c /redes/wpa_supplicant.conf -B
	dhclient wlan0
fi
else
echo "Ok, hasta luego ^^"
fi
y ustedes ?
EDIT: todavia no dormi y ahora que lo veo de nuevo me da verguenza :-S podria haber usado un swich o un case :-S o por lo menos hacerlo mas proliko :'( que catasrtofe :'(
__________________
Usuario GNU/linux registrado Nº450915
"Sólo hay un problema con el sentido común: que no es demasiado común" -- Milt Bryce
sunos no ha iniciado sesión   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:47 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
NGD Studios 2002-2024 © All rights reserved