tinc-up: set interfaces up afterwards

This commit is contained in:
Jörg Thalheim 2014-12-26 00:33:08 +01:00
parent b870478b72
commit adc63b9765

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
@ -24,9 +24,11 @@ set_mac() {
else else
ifconfig "$interface" ether "$mac_address" ifconfig "$interface" ether "$mac_address"
fi fi
ifconfig "$interface" up
elif has ip; then elif has ip; then
ip link set dev "$interface" down ip link set dev "$interface" down
ip link set dev "$interface" address "$mac_address" ip link set dev "$interface" address "$mac_address"
ip link set dev "$interface" up
else else
die "no suitable program found to configure the network interface, need iproute2 or ifconfig" die "no suitable program found to configure the network interface, need iproute2 or ifconfig"
fi fi