]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Revert "network: remove awk call and replace it with a shell function"
authorHarald Hoyer <harald@redhat.com>
Tue, 7 Jun 2016 11:24:47 +0000 (13:24 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 7 Jun 2016 12:27:35 +0000 (14:27 +0200)
This reverts commit 71867b665cea6b4d9814ea0386baf0500db06806.

network needs posix shell

dracut-functions.sh
modules.d/40network/module-setup.sh
modules.d/40network/net-lib.sh

index 146dbea0583b02377eea2576112e75f0c7167638..4496bfe6c129e2d09172e4f542c8f21c254429da 100755 (executable)
@@ -37,16 +37,6 @@ str_starts() { [ "${1#"$2"*}" != "$1" ]; }
 # returns OK if $1 contains literal string $2 at the end, and isn't empty
 str_ends() { [ "${1%*"$2"}" != "$1" ]; }
 
-uniq_lines() {
-    local -A lines
-    while read -r line; do
-        if ! [[ ${lines[$line]} ]]; then
-            echo "$line"
-            lines[$line]=1
-        fi
-    done
-}
-
 # find a binary.  If we were not passed the full path directly,
 # search in the usual places to find the binary.
 find_binary() {
index 4bf93cc6d775a2166f2f2a092016442741fcfca1..53b4b60b31cd48c91ea3f7ebb59d6063aca38ecb 100755 (executable)
@@ -23,7 +23,7 @@ installkernel() {
 # called by dracut
 install() {
     local _arch _i _dir
-    inst_multiple ip arping dhclient sed
+    inst_multiple ip arping dhclient sed awk
     inst_multiple -o ping ping6
     inst_multiple -o brctl
     inst_multiple -o teamd teamdctl teamnl
index 4fd274e8decebff07a60149509d983164d24d1c8..005ad1bb82b1438f73a709bf616a0067cfbd1090 100755 (executable)
@@ -120,7 +120,7 @@ setup_net() {
     [ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
     # set up resolv.conf
     [ -e /tmp/net.$netif.resolv.conf ] && \
-        uniq_lines < /tmp/net.$netif.resolv.conf > /etc/resolv.conf
+        awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf
     [ -e /tmp/net.$netif.gw ]            && . /tmp/net.$netif.gw
 
     # add static route