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
1 changed files with 3 additions and 1 deletions

View File

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