From 65cbdc43f60330900693415ffe84498a96cd3450 Mon Sep 17 00:00:00 2001 From: Alexey Shabalin Date: Thu, 20 Dec 2018 14:19:08 +0300 Subject: [PATCH] gh-133: Fixed generate network config for systemd-networkd. (#133) * fix condition for add SEARCH_DOMAIN * fixed condition gen_iface for IPv4 and IPv6 --- src/etc/one-context.d/loc-10-network##arch.one | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/etc/one-context.d/loc-10-network##arch.one b/src/etc/one-context.d/loc-10-network##arch.one index 70fcd3d..1b882cb 100755 --- a/src/etc/one-context.d/loc-10-network##arch.one +++ b/src/etc/one-context.d/loc-10-network##arch.one @@ -154,7 +154,7 @@ EOT done fi - if [ -n "$DNS" ]; then + if [ -n "$SEARCH_DOMAIN" ]; then for domain in $SEARCH_DOMAIN; do echo "Domains=$domain" done @@ -180,7 +180,7 @@ EOT done fi - if [ -n "$DNS" ]; then + if [ -n "$SEARCH_DOMAIN" ]; then for domain in $SEARCH_DOMAIN; do echo "Domains=$domain" done @@ -258,10 +258,13 @@ EOT fi - [[ -n $IP || -n $CONTEXT_FORCE_IPV4 ]] && gen_iface_conf - [[ -n $IP6 ]] && gen_iface6_conf - - ) > /etc/systemd/network/${DEV}.network + if [ -n "$IP" ] || [ -n "$CONTEXT_FORCE_IPV4" ]; then + gen_iface_conf + fi + if [ -n "$IP6" ]; then + gen_iface6_conf + fi + ) > /etc/systemd/network/"${DEV}".network done }