#! /bin/sh

if [ -z "$1" ]; then
    echo "Usage: `basename $0` <service>"
    exit 1
fi

service="$1"
test_dir=/usr/lib/connman/test

connmand -n -d > connman.log 2>&1 &
connman_pid=$!

sleep 2s

$test_dir/set-ipv4-method "$service" dhcp

sleep 2

$test_dir/test-connman autoconnect "$service" 1

kill $connman_pid
