From 8bb5677527637fd63cccebbf1409990403232e07 Mon Sep 17 00:00:00 2001 From: Oertel Date: Mon, 30 Jul 2018 14:59:58 +0200 Subject: [PATCH 1/2] replaced the depricated ifconfig command by the ip command --- libuavcan_drivers/linux/scripts/uavcan_add_vcan | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libuavcan_drivers/linux/scripts/uavcan_add_vcan b/libuavcan_drivers/linux/scripts/uavcan_add_vcan index ffa1c43bf0..39c3344c15 100755 --- a/libuavcan_drivers/linux/scripts/uavcan_add_vcan +++ b/libuavcan_drivers/linux/scripts/uavcan_add_vcan @@ -19,11 +19,14 @@ if [ "$1" == '--help' ] || [ "$1" == '-h' ]; then echo "$HELP"; exit; fi IFACE="$1" -if [ $(ifconfig -a | grep -c "^$IFACE") -eq "1" ]; then - ifconfig $IFACE up +ip link show $IFACE > /dev/null +if [ $? == 0 ]; then + ip link set up $IFACE exit fi +echo "load driver and start $IFACE" + modprobe can modprobe can_raw modprobe can_bcm @@ -32,6 +35,4 @@ modprobe vcan ip link add dev $IFACE type vcan ip link set up $IFACE -ifconfig $IFACE up || exit 1 - echo "New iface $IFACE added successfully. To delete: ip link delete $IFACE" From ff040ea166f5ef8a0c118499c9657ae40d5204ad Mon Sep 17 00:00:00 2001 From: Oertel Date: Mon, 30 Jul 2018 22:29:06 +0200 Subject: [PATCH 2/2] removed the confusing "echo ..." line (it confused Pavel) --- libuavcan_drivers/linux/scripts/uavcan_add_vcan | 2 -- 1 file changed, 2 deletions(-) diff --git a/libuavcan_drivers/linux/scripts/uavcan_add_vcan b/libuavcan_drivers/linux/scripts/uavcan_add_vcan index 39c3344c15..138007927f 100755 --- a/libuavcan_drivers/linux/scripts/uavcan_add_vcan +++ b/libuavcan_drivers/linux/scripts/uavcan_add_vcan @@ -25,8 +25,6 @@ if [ $? == 0 ]; then exit fi -echo "load driver and start $IFACE" - modprobe can modprobe can_raw modprobe can_bcm