mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-30 14:44:07 +08:00
Improved vcan_init
This commit is contained in:
parent
39933ba41d
commit
b3866feda5
@ -5,9 +5,9 @@
|
||||
|
||||
HELP="Initializes and brings up a virtual CAN interface.
|
||||
Usage:
|
||||
`basename $0` <iface-index>
|
||||
`basename $0` <iface-name>
|
||||
Example:
|
||||
`basename $0` 0"
|
||||
`basename $0` vcan0"
|
||||
|
||||
function die() { echo $@ >&2; exit 1; }
|
||||
|
||||
@ -17,7 +17,7 @@ if [ "$1" == '--help' ] || [ "$1" == '-h' ]; then echo "$HELP"; exit; fi
|
||||
|
||||
# ---------------------------------------------------------
|
||||
|
||||
IFACE="vcan$1"
|
||||
IFACE="$1"
|
||||
|
||||
if [ $(ifconfig -a | grep -c "^$IFACE") -eq "1" ]; then
|
||||
ifconfig $IFACE up
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user