Skip to content

Commit

Permalink
Merge pull request #29 from opentechinstitute/dhcp-timeout
Browse files Browse the repository at this point in the history
Dhcp timeout

tested by areynold
  • Loading branch information
areynold committed Jul 11, 2013
2 parents f120494 + d4b0aaa commit ef11653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions openwrt/etc/config/commotiond
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
config daemon

config node
option 'dhcp_timeout' '20'

4 changes: 3 additions & 1 deletion openwrt/lib/netifd/proto/commotion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ init_proto "$@"

WIFI_DEVICE=
TYPE=
DHCP_TIMEOUT=20

configure_wifi_iface() {
local config="$1"
Expand Down Expand Up @@ -73,8 +74,9 @@ proto_commotion_setup() {

if [ "$type" = "plug" ]; then
local dhcp_status
local dhcp_timeout="$(uci_get commotiond @node[0] dhcp_timeout "$DHCP_TIMEOUT")"
export DHCP_INTERFACE="$config"
udhcpc -q -i ${iface} -t 2 -T 5 -n -s /lib/netifd/commotion.dhcp.script
udhcpc -q -i ${iface} -t 2 -T "$dhcp_timeout" -n -s /lib/netifd/commotion.dhcp.script
dhcp_status=$?
export DHCP_INTERFACE=""
if [ $dhcp_status -eq 0 ]; then
Expand Down

0 comments on commit ef11653

Please sign in to comment.