2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3 # udhcpc script edited by Tim Riker <Tim@Rikers.org>
5 [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
7 TEMP_DHCP_FILE="/tmp/udhcpc_dyn.tmp"
8 UDHCPC_LOG="/tmp/udhcpc_log"
13 /usr/bin/env > /tmp/test_env
15 [ -n "$subnet" ] && NET_ADDR="$ip/$subnet"
16 [ -n "$broadcast" ] && BRD_ADDR="$broadcast"
20 /sbin/ifconfig $interface 0.0.0.0
24 /sbin/ifconfig $interface $ip $BROADCAST $NETMASK up
25 echo "$interface $ip $BROADCAST $NETMASK" >> $UDHCPC_LOG
26 # if [ -n "$router" ] ; then
27 # echo "deleting routers" >> $UDHCPC_LOG
28 # while /sbin/route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
32 # for i in $router ; do
33 # echo "router $i" >> $UDHCPC_LOG
34 # /sbin/route add default gw $i dev $interface
38 echo serveraddr $serverid >> $TEMP_DHCP_FILE
39 echo leasetime $lease >> $TEMP_DHCP_FILE
41 if [ -n $router ]; then
43 # Take the first router
49 if [ -z $subnet ]; then
50 subnet="255.255.255.0"
52 if [ -z $local_gateway ]; then
53 local_gateway="0.0.0.0"
56 @BIN_DIR@/vconftool set -t string memory/private/wifi_direct_manager/p2p_ifname ${interface} -f
57 @BIN_DIR@/vconftool set -t string memory/private/wifi_direct_manager/p2p_subnet_mask ${subnet} -f
58 @BIN_DIR@/vconftool set -t string memory/private/wifi_direct_manager/p2p_gateway ${local_gateway} -f
59 @BIN_DIR@/vconftool set -t string memory/private/wifi_direct_manager/dhcpc_server_ip ${serverid} -f
60 @BIN_DIR@/vconftool set -t string memory/private/wifi_direct_manager/p2p_local_ip ${ip} -f
61 echo $i >> $TEMP_DHCP_FILE