diff options
author | Daniel Hansson <daniel@techandme.se> | 2017-06-15 17:15:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-15 17:15:44 +0300 |
commit | 898f0354a2d79385709ce33f76fed29067b274b5 (patch) | |
tree | 756c35acd5de355a6f45a1736872770766ac31cd /lets-encrypt | |
parent | 8f1d88d21716baff6bab02901ff5fd4a1fdadbed (diff) |
Set hostname in /etc/hosts (#269)
Diffstat (limited to 'lets-encrypt')
-rw-r--r-- | lets-encrypt/test-new-config.sh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lets-encrypt/test-new-config.sh b/lets-encrypt/test-new-config.sh index 43e96baf..d3e5cdff 100644 --- a/lets-encrypt/test-new-config.sh +++ b/lets-encrypt/test-new-config.sh @@ -36,6 +36,8 @@ then echo "Setting hostname to $FQDOMAIN..." sudo sh -c "echo 'ServerName $FQDOMAIN' >> /etc/apache2/apache2.conf" sudo hostnamectl set-hostname "$FQDOMAIN" + # Change /etc/hosts as well + sed -i "s|127.0.1.1.*|127.0.1.1 $FQDOMAIN $(hostname -s)|g" /etc/hosts fi # Set trusted domains |