#!/bin/bash ########################################################################### # # Copyright (c) 2020-2024 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 # # @author (last) Peter Lucia # @date (last) 06-Aug-2020 # @author (original) Peter Lucia # @date (original) 01-Apr-2020 # ############################################################################ 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