mirror of
https://github.com/joglomedia/LEMPer.git
synced 2026-04-13 00:18:31 +00:00
Fix /etc/hosts add
This commit is contained in:
@@ -508,6 +508,7 @@ function preflight_system_check() {
|
||||
|
||||
if grep -q "${SERVER_HOSTNAME}" /etc/hosts; then
|
||||
run sed -i".bak" "/${SERVER_HOSTNAME}/d" /etc/hosts
|
||||
run bash -c "echo -e '${SERVER_IP_LOCAL}\t${SERVER_HOSTNAME}' >> /etc/hosts"
|
||||
else
|
||||
run bash -c "echo -e '\n# LEMPer local hosts\n${SERVER_IP_LOCAL}\t${SERVER_HOSTNAME}' >> /etc/hosts"
|
||||
fi
|
||||
@@ -528,8 +529,8 @@ function preflight_system_check() {
|
||||
|
||||
# Check if the hostname is pointed to server IP address.
|
||||
if [[ $(dig "${HOSTNAME}" +short) != "${SERVER_IP}" && $(dig "${HOSTNAME}" +short) != "${SERVER_IP_LOCAL}" ]]; then
|
||||
error "It seems that your server's hostname '${HOSTNAME}' is not yet pointed to your server's IP address."
|
||||
echo -n "In production environment you should add an A record and points it to this server IP address "; status -n "${SERVER_IP}"; echo " !"
|
||||
error "It seems that your server's hostname '${HOSTNAME}' is not yet pointed to your server's public IP address."
|
||||
echo -n "In production environment you need to add an A record and point it to this IP address "; status -n "${SERVER_IP}"; echo " !"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user