X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=recipes-connectivity%2Fkuksa-val%2Fcan-dev-helper%2Fcan-dev-helper.sh;h=d57604c07520a58f1e5906d93f6c546ba4dfaf2f;hb=175c760662f98551e83fb60a427baeff1c3f52af;hp=de9894d76de1c36e1384f6c5e5a1791272f22667;hpb=ca7d98904253c7404c3e6384ebb53d922a3c538a;p=AGL%2Fmeta-agl-demo.git diff --git a/recipes-connectivity/kuksa-val/can-dev-helper/can-dev-helper.sh b/recipes-connectivity/kuksa-val/can-dev-helper/can-dev-helper.sh index de9894d76..d57604c07 100644 --- a/recipes-connectivity/kuksa-val/can-dev-helper/can-dev-helper.sh +++ b/recipes-connectivity/kuksa-val/can-dev-helper/can-dev-helper.sh @@ -15,6 +15,9 @@ vcan_up() { } CONF=/etc/kuksa-dbc-feeder/config.ini +if [ $# -gt 0 ]; then + CONF=$1 +fi if [ ! -f $CONF ]; then exit 0 @@ -22,7 +25,7 @@ fi # Ideally the parsing would take the "[can]" section into # account, but this should work for now. -interface=$(grep ^port= $CONF |cut -d= -f2 |tr -d '"') +interface=$(sed -nr '/\[can\]/,/\[/{s/^port *= *//p}' $CONF) if [ -n "$interface" ]; then echo "Checking $interface" if ! ifconfig $interface >/dev/null 2>&1; then