iankelling.org
/
git
/
distro-setup
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
246e575
)
avoid sudo resolv alert on rerun
author
Ian Kelling
<ian@iankelling.org>
Fri, 18 Oct 2019 17:33:29 +0000
(13:33 -0400)
committer
Ian Kelling
<ian@iankelling.org>
Fri, 18 Oct 2019 17:33:29 +0000
(13:33 -0400)
distro-begin
patch
|
blob
|
history
diff --git
a/distro-begin
b/distro-begin
index abcb892f5e1f4747e64cd6a7adb474af8ba21555..570d077ca68d1fc9f5bdbb666962de4e83506bdb 100755
(executable)
--- a/
distro-begin
+++ b/
distro-begin
@@
-195,8
+195,10
@@
if [[ $HOSTNAME != $(cat /etc/hostname) ]]; then
echo $HOSTNAME > /etc/hostname
hostname -F /etc/hostname
fi
-sudo $sed -i '/^127\.0\.1\.1/d' /etc/hosts
-echo "127.0.1.1 $HOSTNAME.b8.nz $HOSTNAME" | sudo tee -a /etc/hosts
+sudo sed -i --follow-symlinks -f - /etc/hosts <<EOF
+\$a 127.0.1.1 $HOSTNAME.b8.nz $HOSTNAME
+/^127\.0\.1\.1/d
+EOF
##### exit first stage if running as root