Improved vcan_init

This commit is contained in:
Pavel Kirienko 2014-03-31 17:17:43 +04:00
parent 39933ba41d
commit b3866feda5

View File

@ -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