Skip to content

Instantly share code, notes, and snippets.

@stevz
Created March 5, 2011 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevz/856177 to your computer and use it in GitHub Desktop.
Save stevz/856177 to your computer and use it in GitHub Desktop.
BT coneccion
#!/bin/sh
# Script para conectarse con tu movil via bluetooth a internet
echo "Conexion por 3g usando Bluetooth"
DevNum=0
case $1 in
start)
dispositivo=`gdialog --inputbox "Ingrese nombre de su equipo" 2>&1`
MAC=$(hcitool scan | grep 'dispositivo' | awk '{print $1}')
canal=$(sdptool search --bdaddr $MAC DUN | grep Channel | awk '{print $2}')
rfcomm bind 0 $MAC $canal
wvdial nokia-bt &
;;
stop)
rfcomm release $DevNum
killall wvidial
;;
status)
rfcomm show $DevNum
/sbin/ifconfig ppp0 | grep addr
;;
*)
cat<<EOF
Forma de uso:
$0 [ start | stop | status ]
EOF
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment