Skip to content

Commit

Permalink
v7.9
Browse files Browse the repository at this point in the history
+ DietPi-Config | Show all nameserver entries from /etc/resolv.conf (in a single line). The trailing blank is removed already since '{print $2,$3}' implies it when only one nameserver is applied.
  • Loading branch information
MichaIng committed Dec 11, 2021
1 parent b9943d3 commit 4c01caa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dietpi/dietpi-config
Original file line number Diff line number Diff line change
Expand Up @@ -2418,8 +2418,8 @@ NB: All Ethernet connections will be dropped!' && Network_ApplyChanges
ETH_GATEWAY_STATIC=$(mawk '$1=="gateway"{print $2;exit}' /etc/network/interfaces)
ETH_MASK_STATIC=$(mawk '$1=="netmask"{print $2;exit}' /etc/network/interfaces)
ETH_DNS_STATIC=$(mawk '$1=="dns-nameservers"{print $2,$3;exit}' /etc/network/interfaces)
[[ $ETH_DNS_STATIC ]] || ETH_DNS_STATIC=$(mawk '$1=="nameserver"{print $2;exit}' /etc/resolv.conf)
# Remove trailing space in case of single nameserver, due to mawk '{print $2,$3}'
[[ $ETH_DNS_STATIC ]] || ETH_DNS_STATIC=$(mawk '$1=="nameserver"{print $2}' ORS=' ' /etc/resolv.conf)
# Remove trailing space in case of single nameserver, due to mawk '{print $2,$3}' respectively ORS=' '
ETH_DNS_STATIC=${ETH_DNS_STATIC%[[:blank:]]}
ETH_DEV_IFACE=$(G_GET_NET -q -t eth iface) || ETH_DEV_IFACE='eth0'
ETH_DISABLED=$(( ! $(grep -Ecm1 "^[[:blank:]]*(allow-hotplug|auto)[[:blank:]]+$ETH_DEV_IFACE" /etc/network/interfaces) ))
Expand All @@ -2435,8 +2435,8 @@ NB: All Ethernet connections will be dropped!' && Network_ApplyChanges
WIFI_GATEWAY_STATIC=$(mawk '$1=="gateway"{print $2}' /etc/network/interfaces | mawk 'NR==2')
WIFI_MASK_STATIC=$(mawk '$1=="netmask"{print $2}' /etc/network/interfaces | mawk 'NR==2')
WIFI_DNS_STATIC=$(mawk '$1=="dns-nameservers"{print $2,$3}' /etc/network/interfaces | mawk 'NR==2')
[[ $WIFI_DNS_STATIC ]] || WIFI_DNS_STATIC=$(mawk '$1=="nameserver"{print $2;exit}' /etc/resolv.conf)
# Remove trailing space in case of single nameserver, due to mawk '{print $2,$3}'
[[ $WIFI_DNS_STATIC ]] || WIFI_DNS_STATIC=$(mawk '$1=="nameserver"{print $2}' ORS=' ' /etc/resolv.conf)
# Remove trailing space in case of single nameserver, due to mawk '{print $2,$3}' respectively ORS=' '
WIFI_DNS_STATIC=${WIFI_DNS_STATIC%[[:blank:]]}
WIFI_DEV_IFACE=$(G_GET_NET -q -t wlan iface) || WIFI_DEV_IFACE='wlan0'
WIFI_DISABLED=$(( ! $(grep -Ecm1 "^[[:blank:]]*(allow-hotplug|auto)[[:blank:]]+$WIFI_DEV_IFACE" /etc/network/interfaces) ))
Expand Down

0 comments on commit 4c01caa

Please sign in to comment.