![]() |
2007-06-17
, 22:36
|
|
Posts: 832 |
Thanked: 75 times |
Joined on Dec 2005
@ Phoenix, AZ
|
#22
|
![]() |
2007-06-19
, 07:23
|
|
Posts: 1,743 |
Thanked: 1,231 times |
Joined on Jul 2006
@ Twickenham, UK
|
#23
|
![]() |
2007-06-25
, 14:37
|
Posts: 2 |
Thanked: 1 time |
Joined on Jun 2007
|
#24
|
/usr/bin/bluetoothPAN * * com.nokia.icd status_changed * WLAN_ADHOC
echo "usr/bin/bluetoothPAN * * com.nokia.icd status_changed * WLAN_ADHOC" >> /etc/dbus-scripts.d/dbus-scripts-example
/etc/init.d/dbus-scripts restart
echo '#! /bin/sh # # This script is invoked by dbus-scripts to enable Bluetooth PAN access # # use gainroot to become root and relaunch itself if [ `id -u` != 0 ] ; then #if not already root, call itself as root exec sudo gainroot <<EOF exec $0 $* EOF exit $? fi BTADDR='your BT MAC ADDRESS' BTNAME=$5 # The following 2 lines are needed for the static configuration # If you are using a DHCP configuration you can comment these 2 lines IP=192.168.2.2 GW=192.168.2.1 # Here you MUST Define the DNS Server -- $NS variable NS=192.168.2.1 IFACE=bnep0 PAN_ROLE=PANU # remote PAN role, one of PANU, NAP, GN #thanks to inz on #maemo IRC channel for this infoprint(){ dbus-send >/dev/null 2>&1 --system --print-reply --dest=com.nokia.statusbar /com/nokia/statusbar com.nokia.statusbar.system_note_infoprint "string:$*" & } dummy_wlan_down(){ if ifconfig wlan0 | grep -q "UP BROADCAST RUNNING" ; then # OK wlan is up, do we have IP set up? if not (=our dummy ad-hoc) bring wlan0 down ifconfig wlan0 | grep -q "inet addr" || ifconfig wlan0 down fi } bnep_start(){ dummy_wlan_down #insmod just to be sure insmod /mnt/initfs/lib/modules/current/bnep.ko #start PAN Bluetooth connection pand --connect $BTADDR -d $PAN_ROLE # wait for the interface created by pand s=60 echo -n "Waiting $s secs for $IFACE" while [ $s -gt 0 ] ; do ifconfig $IFACE >/dev/null 2>&1 && break s=$((s-1)) [ -t 1 ] && echo -n "." sleep 1 done echo if ifconfig $IFACE >/dev/null 2>&1 ; then # bring it up echo "OK, bringing $IFACE up" # Comment the following two lines if you want to use the DHCP configuration ifconfig $IFACE $IP up route add default gw $GW sleep 2 # Uncomment the following line if you want to have DHCP configuration # WARNING -- You must set the DNS Server -- $NS variable -- search above for $NS variable # udhcpc -i bnep0 # The nameserver must be defined in the $NS variable, # even with DCHP configuration, # because it seems like the udhcpc have to be # configured a little bit more, to work appropriatly. echo "nameserver $NS" > /tmp/resolv.conf.lo [ -t 1 ] || infoprint "Connected to $BTNAME" else echo "Error: $IFACE not available." [ -t 1 ] || infoprint "Connection failed for $BTNAME" fi } bnep_stop(){ echo "OK, bringing $IFACE down" # Uncomment this line if you're using DHCP configuration # This line tries to kill the DHCP Client # kill -15 `ps uaxwww|grep udhcpc|grep -v grep|cut -c 1-5` ifconfig $IFACE down echo -n '' >/tmp/resolv.conf.lo pand -k $BTADDR sleep 1 rmmod bnep [ -t 1 ] || infoprint "Disconnected from $BTNAME" } if [ "$5" = "BlueToothPAN" ] then case "$7" in CONNECTED) echo "Starting $BTNAME" bnep_start ;; IDLE) echo "Stopping $BTNAME" bnep_stop ;; esac fi exit 0' > test
The Following User Says Thank You to PePPeRV For This Useful Post: | ||
![]() |
2007-06-29
, 01:32
|
Posts: 25 |
Thanked: 1 time |
Joined on Apr 2007
|
#25
|
![]() |
2007-06-29
, 09:22
|
|
Posts: 11 |
Thanked: 2 times |
Joined on May 2007
@ Boston, MA
|
#26
|
![]() |
2007-06-29
, 15:21
|
Posts: 25 |
Thanked: 1 time |
Joined on Apr 2007
|
#27
|
![]() |
2007-06-30
, 00:07
|
|
Posts: 11 |
Thanked: 2 times |
Joined on May 2007
@ Boston, MA
|
#28
|
![]() |
2007-06-30
, 01:23
|
Posts: 25 |
Thanked: 1 time |
Joined on Apr 2007
|
#29
|
![]() |
2007-06-30
, 05:39
|
|
Posts: 11 |
Thanked: 2 times |
Joined on May 2007
@ Boston, MA
|
#30
|
Adusting to being a technophile...or not