1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-22 15:05:20 +02:00

nanonote-files: wpan.nn: add option for start dirtpan

This commit is contained in:
Xiangfu 2012-06-16 10:21:27 +08:00
parent 7858183155
commit 595140ee63

View File

@ -1,31 +1,44 @@
#!/bin/sh #!/bin/sh
if [ "$1" != "client" ] && [ "$1" != "host" ]; then
echo "wpan.nn host|client [dirtpan]"
exit 1
fi
cd /lib/modules/`uname -r` uname -a | grep BenNanoNote > /dev/null 2>&1
echo jz4740-mmc.0 > /sys/bus/platform/drivers/jz4740-mmc/unbind if [ "$?" == "0" ]; then
insmod at86rf230.ko echo jz4740-mmc.0 > /sys/bus/platform/drivers/jz4740-mmc/unbind
insmod spi_atben.ko insmod /lib/modules/`uname -r`/at86rf230.ko
insmod /lib/modules/`uname -r`/spi_atben.ko
cd ${HOME} fi
iz add wpan-phy0 iz add wpan-phy0
if [ "$1" == "2" ]; then
if [ "$1" == "client" ]; then
ip link set wpan0 address de:ad:be:af:ca:fe:ba:b2 ip link set wpan0 address de:ad:be:af:ca:fe:ba:b2
else else
ip link set wpan0 address de:ad:be:af:ca:fe:ba:b1 ip link set wpan0 address de:ad:be:af:ca:fe:ba:b1
fi fi
ifconfig wpan0 up ifconfig wpan0 up
if [ "$1" == "2" ]; then if [ "$1" == "client" ]; then
iz assoc wpan0 777 1 11 short iz assoc wpan0 777 1 11 short
if [ "$2" == "dirtpan" ]; then
dirtpan 777 8001 1 'ifconfig tun0 10.8.0.2 dstaddr 10.8.0.1 up' &
else
izchat 777 8001 1 izchat 777 8001 1
#dirtpan 777 8001 1 'ifconfig tun0 10.8.0.2 dstaddr 10.8.0.1 up' & fi
else else
rm -f /tmp/lease rm -f /tmp/lease
izcoordinator -d 1 -l /tmp/lease -i wpan0 -p 0x777 -s 1 -c 11 & izcoordinator -d 1 -l /tmp/lease -i wpan0 -p 0x777 -s 1 -c 11 &
sleep 1
if [ "$2" == "dirtpan" ]; then
dirtpan 777 1 8001 'ifconfig tun0 10.8.0.1 dstaddr 10.8.0.2 up' &
else
izchat 777 1 8001 izchat 777 1 8001
#dirtpan 777 1 8001 'ifconfig tun0 10.8.0.1 dstaddr 10.8.0.2 up' & fi
fi fi