Skip to content

Commit e8e7b0d

Browse files
authored
Add: append domain to /etc/hosts in setup script (#977)
1 parent 15c7926 commit e8e7b0d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.package/setup.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ if ! get_env_var "DOMAIN"; then
6666
done
6767
fi
6868

69+
# Add domain to /etc/hosts
70+
domain="$(. ./.env 2>/dev/null; printf '%s' "$DOMAIN")"
71+
host="127.0.0.1 ${domain}"
72+
if ! grep -qFx "$host" /etc/hosts 2>/dev/null; then
73+
printf '%s\n' "$host" | sudo tee -a /etc/hosts >/dev/null
74+
fi
75+
6976
# SECRET_KEY
7077
if ! get_env_var "SECRET_KEY"; then
7178
secret_key=$(openssl rand -hex 32)

0 commit comments

Comments
 (0)