Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | CONFIGF=/var/lib/connman/wired.config |
| 4 | |
| 5 | # Extract wired network config from /proc/cmdline |
| 6 | NET_CONF=`cat /proc/cmdline |sed -ne 's/^.*ip=\([^ ]*\):\([^ ]*\):\([^ ]*\):\([^ ]*\).*$/\1\/\4\/\3/p'` |
| 7 | |
| 8 | # Check if eth0 is already set via kernel cmdline |
| 9 | if [ "x$NET_CONF" = "x" ]; then |
| 10 | # Wired interface is not configured via kernel cmdline |
| 11 | # Remove connman config file template |
| 12 | rm -f ${CONFIGF} |
| 13 | else |
| 14 | # Setup a connman config accordingly |
| 15 | sed -i -e "s|^IPv4 =.*|IPv4 = ${NET_CONF}|" ${CONFIGF} |
| 16 | fi |