mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 08:36:08 +08:00
replaced the depricated ifconfig command by the ip command
This commit is contained in:
@@ -19,11 +19,14 @@ if [ "$1" == '--help' ] || [ "$1" == '-h' ]; then echo "$HELP"; exit; fi
|
||||
|
||||
IFACE="$1"
|
||||
|
||||
if [ $(ifconfig -a | grep -c "^$IFACE") -eq "1" ]; then
|
||||
ifconfig $IFACE up
|
||||
ip link show $IFACE > /dev/null
|
||||
if [ $? == 0 ]; then
|
||||
ip link set up $IFACE
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "load driver and start $IFACE"
|
||||
|
||||
modprobe can
|
||||
modprobe can_raw
|
||||
modprobe can_bcm
|
||||
@@ -32,6 +35,4 @@ modprobe vcan
|
||||
ip link add dev $IFACE type vcan
|
||||
ip link set up $IFACE
|
||||
|
||||
ifconfig $IFACE up || exit 1
|
||||
|
||||
echo "New iface $IFACE added successfully. To delete: ip link delete $IFACE"
|
||||
|
||||
Reference in New Issue
Block a user