Merge branch 'master' of git.higgsboson.tk:Mic92/evenet

Conflicts:
	tinc-up
This commit is contained in:
root 2015-01-02 00:21:28 +01:00
commit 26c20e5fb5
2 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Subnet = 02:1F:C8:16:F2:C0
Address = tinc.higgsboson.tk
Port = 666
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAsGG/m+wr4Q5yRiJXojYu9bV1AgS7U7xUTe39RBAnuEEbpxgQ3SKP
LLqf3ZBRkSeJ4xpevv66h7rR1/CIJ+xGbi2+m2QHLB66tGYUKQZIDa8TY9oss6lt

15
tinc-up
View File

@ -64,12 +64,23 @@ set_ip() {
fi
}
start_dhclient() {
local interface=$1
if [[ "$OSTYPE" == "linux-gnu" ]]; then
dhclient -nw "$interface"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
dhclient -b "$interface"
else
nohup setsid dhclient "$interface" >/dev/null 2>&1
fi
}
start_dhcp() {
local interface=$1
if has dhcpcd; then
dhcpcd "$interface"
dhcpcd -b -n "$interface"
elif has dhclient; then
dhclient "$interface"
start_dhclient "$interface"
elif [[ "$OSTYPE" == "darwin"* ]]; then # TODO untested
ipconfig set "$interface" DHCP
else