mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
appliance init: find NIC name for dhcpcd
dhcpcd requires an interface name as parameter to work. We are now getting it from /proc/sys/net/ipv4/conf/ folder children. dhclient on Debian also has the problem, thus use the guessed interface name for it too.
This commit is contained in:
committed by
Richard W.M. Jones
parent
37a0378556
commit
2d2a65504d
@@ -108,10 +108,11 @@ ip addr add 127.0.0.1/8 brd + dev lo scope host
|
||||
ip link set dev lo up
|
||||
|
||||
if test "$guestfs_network" = 1; then
|
||||
iface=$(ls -I all -I default -I lo /proc/sys/net/ipv4/conf)
|
||||
if dhclient --version >/dev/null 2>&1; then
|
||||
dhclient
|
||||
dhclient $iface
|
||||
else
|
||||
dhcpcd
|
||||
dhcpcd $iface
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user