1 Star 0 Fork 58

氿肆/quard_star_tutorial

forked from Quard/quard_star_tutorial 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config_vcan.sh 520 Bytes
一键复制 编辑 原始数据 按行查看 历史
Quard 提交于 2022-06-08 16:31 . qemu:quard star soc add can controller ip
#!/bin/bash
set -e
MODE=\
"config_vcan | \
release_vcan"
USER_NAME=$(whoami)
USAGE="usage $0 [$MODE] [<CAN_NAME>] "
if [ $# == 2 ] ; then
CAN_NAME=$1
else
CAN_NAME=vcan0
fi
config_vcan()
{
modprobe vcan
ip link add dev $CAN_NAME type vcan
ip link set up $CAN_NAME
}
release_vcan()
{
ip link set down $CAN_NAME
ip link delete dev $CAN_NAME
}
case "$1" in
config_vcan)
config_vcan
;;
release_vcan)
release_vcan
;;
--help)
echo $USAGE
exit 0
;;
*)
echo $USAGE
exit 1
;;
esac
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/maochenxuan/quard_star_tutorial.git
git@gitee.com:maochenxuan/quard_star_tutorial.git
maochenxuan
quard_star_tutorial
quard_star_tutorial
main

搜索帮助