Commit 5edaeb8c authored by Joshua Tauberer's avatar Joshua Tauberer

add a new autoconfiguration option PRIMARY_HOSTNAME=auto to simply grab the...

add a new autoconfiguration option PRIMARY_HOSTNAME=auto to simply grab the hostname from reverse DNS

drawn from https://github.com/Toilal/mailinabox/commit/5b23a06a7410e4530a56fd6200a6c46c3c6ea9b6.
parent 3a28d1b0
...@@ -206,7 +206,11 @@ if [ "$PUBLIC_IPV6" = "auto" ]; then ...@@ -206,7 +206,11 @@ if [ "$PUBLIC_IPV6" = "auto" ]; then
# Use a public API to get our public IPv6 address, or fall back to local network configuration. # Use a public API to get our public IPv6 address, or fall back to local network configuration.
PUBLIC_IPV6=$(get_publicip_from_web_service 6 || get_default_privateip 6) PUBLIC_IPV6=$(get_publicip_from_web_service 6 || get_default_privateip 6)
fi fi
if [ "$PRIMARY_HOSTNAME" = "auto-easy" ]; then if [ "$PRIMARY_HOSTNAME" = "auto" ]; then
# Use reverse DNS to get this machine's hostname. Install bind9-host early.
hide_output apt-get -y install bind9-host
PRIMARY_HOSTNAME=$(get_default_hostname)
elif [ "$PRIMARY_HOSTNAME" = "auto-easy" ]; then
# Generate a probably-unique subdomain under our justtesting.email domain. # Generate a probably-unique subdomain under our justtesting.email domain.
PRIMARY_HOSTNAME=`echo $PUBLIC_IP | sha1sum | cut -c1-5`.justtesting.email PRIMARY_HOSTNAME=`echo $PUBLIC_IP | sha1sum | cut -c1-5`.justtesting.email
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment