Files
poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
Jukka Rissanen 9299df1ebc connman-conf: Avoid appending IPv4 address
If run more than once, the IP addresses would be appended
to IPv4 variable. Avoid that by rewriting the IPv4 always.

(From OE-Core rev: da682e752e351e5bb7636ee187db3eabc208c177)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-22 16:54:37 +00:00

502 B

#!/bin/sh

CONFIGF=/var/lib/connman/wired.config

Extract wired network config from /proc/cmdline

NET_CONF=cat /proc/cmdline |sed -ne 's/^.*ip=\([^ ]*\):\([^ ]*\):\([^ ]*\):\([^ ]*\).*$/\1\/\4\/\3/p'

Check if eth0 is already set via kernel cmdline

if [ "x$NET_CONF" = "x" ]; then # Wired interface is not configured via kernel cmdline # Remove connman config file template rm -f ${CONFIGF} else # Setup a connman config accordingly sed -i -e "s|^IPv4 =.*|IPv4 = ${NET_CONF}|" ${CONFIGF} fi