Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change method to resolve HostName #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wsciaroni
Copy link

Hello!

First, can I thank you for creating this script! It is incredibly useful and saved me a lot of time.

I forked your repo because I encountered an error. When I used your script, I was not getting a letsencrypt cert. After looking at the log, I found that the script was resolving the host's IP address to the NIC's "internal" IP address. To get around this, I added the 'host' debian package. After installing this, I simply updated the script to use the new command. I have tested the script and it is working successfully for me.

Please let me know below if you have any questions!

Again, Thank you for all that you have done on this.

Comment on lines +119 to +126

hostPackage=$(dpkg-query -W --showformat='${Status}\n' host 2>/dev/null)
if [ "x${hostPackage}" != "xinstall ok installed" ]; then
if apt-get -qq install -y host >/dev/null; then
echo "Host package installed"
fi
fi

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add dependency on the host package.

@@ -457,7 +465,7 @@ chmod a+x /etc/letsencrypt/renewal-hooks/deploy/unifi
cat > /usr/local/sbin/certbotrun.sh <<_EOF
#! /bin/sh
extIP=\$(curl -fs -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip")
dnsIP=\$(getent hosts ${dnsname} | cut -d " " -f 1)
dnsIP=\$(host ${dnsname} | cut -d " " -f 4)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the method to resolve the hostname.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant