mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 03:21:35 +08:00
Improved vcan_init
This commit is contained in:
@@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
HELP="Initializes and brings up a virtual CAN interface.
|
HELP="Initializes and brings up a virtual CAN interface.
|
||||||
Usage:
|
Usage:
|
||||||
`basename $0` <iface-index>
|
`basename $0` <iface-name>
|
||||||
Example:
|
Example:
|
||||||
`basename $0` 0"
|
`basename $0` vcan0"
|
||||||
|
|
||||||
function die() { echo $@ >&2; exit 1; }
|
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
|
if [ $(ifconfig -a | grep -c "^$IFACE") -eq "1" ]; then
|
||||||
ifconfig $IFACE up
|
ifconfig $IFACE up
|
||||||
|
|||||||
Reference in New Issue
Block a user