#!/bin/bash ########################################################################### # # Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file setup_virtual_can.sh # # @date 29-Apr-2020 # @author P. Lucia # # @brief Initializes the virtual can interfaces # ############################################################################ iface="can0" if [ "$#" -gt 1 ]; then echo "Please provide only one can interface." echo "Usage (defaults to can0): ./bring_can_iface_down.sh " echo " Use instead: setup_canbus.sh " exit 1 elif [ "$#" -eq 1 ]; then iface="$1" fi sudo ip link add dev "$iface" type vcan sudo ip link set "$iface" up sudo ifconfig "$iface" txqueuelen 10000