input: add the dbus interface and input config parser
[platform/core/system/deviced.git] / scripts / rndis.sh
1 #!/bin/sh
2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3 DEFAULT_IP_ADDR="192.168.129.3"
4
5 #########################################################################################
6 # TM1, TW2 : not configfs and have no ifname
7 # TW3 : configfs and ifname value is "rndis0"
8 # XU3 : configfs and ifname value is "usb0"
9 if [ -e /sys/kernel/config/usb_gadget/hal-gadget/functions/rndis.default/ifname ]
10 then
11         IFNAME=`cat /sys/kernel/config/usb_gadget/hal-gadget/functions/rndis.default/ifname`
12 else
13         IFNAME="usb0"
14 fi
15
16 #########################################################################################
17 VCONF=`vconftool get db/dnet/rndis_ip`
18 if [ $? -ne 0 ]
19 then
20         IP_ADDR=$DEFAULT_IP_ADDR
21 else
22         IP_ADDR=`echo $VCONF | awk -F' ' '{print $4}'`
23 fi
24
25 #########################################################################################
26 if [ x$1 == "xstart" ]
27 then
28         echo "rndis network inteface =" $IFNAME
29         echo "rndis ip address =" $IP_ADDR
30
31         /sbin/ifconfig $IFNAME $IP_ADDR up
32 else
33         /sbin/ifconfig $IFNAME down
34 fi