mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-25 05:20:35 +08:00
Merge pull request #155 from hjoertel/change-start-script
replaced the depricated ifconfig command by the ip command
This commit is contained in:
@@ -19,8 +19,9 @@ if [ "$1" == '--help' ] || [ "$1" == '-h' ]; then echo "$HELP"; exit; fi
|
|||||||
|
|
||||||
IFACE="$1"
|
IFACE="$1"
|
||||||
|
|
||||||
if [ $(ifconfig -a | grep -c "^$IFACE") -eq "1" ]; then
|
ip link show $IFACE > /dev/null
|
||||||
ifconfig $IFACE up
|
if [ $? == 0 ]; then
|
||||||
|
ip link set up $IFACE
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -32,6 +33,4 @@ modprobe vcan
|
|||||||
ip link add dev $IFACE type vcan
|
ip link add dev $IFACE type vcan
|
||||||
ip link set up $IFACE
|
ip link set up $IFACE
|
||||||
|
|
||||||
ifconfig $IFACE up || exit 1
|
|
||||||
|
|
||||||
echo "New iface $IFACE added successfully. To delete: ip link delete $IFACE"
|
echo "New iface $IFACE added successfully. To delete: ip link delete $IFACE"
|
||||||
|
|||||||
Reference in New Issue
Block a user