dhcp: fork in background
This commit is contained in:
parent
e37e5ec635
commit
16f7b622c0
18
tinc-up
18
tinc-up
@ -68,14 +68,24 @@ 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"
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then # TODO
|
||||
untested
|
||||
start_dhclient "$interface"
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then # TODO untested
|
||||
ipconfig set "$interface" DHCP
|
||||
else
|
||||
die "no suitable dhcp program found, need dhcpcd or dhclient"
|
||||
|
Loading…
Reference in New Issue
Block a user