summaryrefslogtreecommitdiffstats
path: root/installers
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-11-10 23:06:40 (EST)
committer P. J. McDermott <pj@pehjota.net>2014-11-10 23:06:40 (EST)
commitadff51b1e29d5eb23e90404239c43bb7644f0fb2 (patch)
tree2b2e2ed4899f321bba4d3d683319538b6ea8732e /installers
parent109dfee1c051b6e48d3a87f9d7f98979eed60a1f (diff)
installers/pc: Combine sed and head commands
Diffstat (limited to 'installers')
-rwxr-xr-xinstallers/pc.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/installers/pc.sh b/installers/pc.sh
index cc42a25..bd83df7 100755
--- a/installers/pc.sh
+++ b/installers/pc.sh
@@ -63,8 +63,9 @@ main()
${mirror:+-m} ${mirror} "${mountpoint}"
mirror="$(printf '%s\n' "${mirror}" | \
sed 's|^.*://||; s|^.*@||; s|/.*$||g;')"
- printf '%s %s\n' "$(nslookup "${mirror}" | sed -n 's/Address: //p' | \
- head -n 1)" "${mirror}" >"${mountpoint}/etc/hosts"
+ printf '%s %s\n' "$(nslookup "${mirror}" | \
+ sed -n '/Address: /{ s/Address: //; p; q; };')" \
+ "${mirror}" >"${mountpoint}/etc/hosts"
"${0%installers/pc.sh}./miniprokit.sh" shell "${mountpoint}" \
<"${0%pc.sh}data/pc.sh"
rm "${mountpoint}/etc/hosts"