mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Use proper templating for dnsmasq conf
This commit is contained in:
parent
85ad965e4d
commit
bc7344b636
2 changed files with 9 additions and 7 deletions
|
@ -27,14 +27,13 @@ do_pre_regen() {
|
||||||
ipv6=$(curl -s -6 https://ip6.yunohost.org 2>/dev/null || true)
|
ipv6=$(curl -s -6 https://ip6.yunohost.org 2>/dev/null || true)
|
||||||
ynh_validate_ip6 "$ipv6" || ipv6=''
|
ynh_validate_ip6 "$ipv6" || ipv6=''
|
||||||
|
|
||||||
|
export ipv4
|
||||||
|
export ipv6
|
||||||
|
|
||||||
# add domain conf files
|
# add domain conf files
|
||||||
for domain in $YNH_DOMAINS; do
|
for domain in $YNH_DOMAINS; do
|
||||||
cat domain.tpl \
|
export domain
|
||||||
| sed "s/{{ domain }}/${domain}/g" \
|
ynh_render_template "domain.tpl" "${dnsmasq_dir}/${domain}"
|
||||||
| sed "s/{{ ip }}/${ipv4}/g" \
|
|
||||||
> "${dnsmasq_dir}/${domain}"
|
|
||||||
[[ -n $ipv6 ]] \
|
|
||||||
&& echo "address=/${domain}/${ipv6}" >> "${dnsmasq_dir}/${domain}"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# remove old domain conf files
|
# remove old domain conf files
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
address=/{{ domain }}/{{ ip }}
|
address=/{{ domain }}/{{ ipv4 }}
|
||||||
|
{% if ipv6 %}
|
||||||
|
address=/{{ domain }}/{{ ipv6 }}
|
||||||
|
{% endif %}
|
||||||
txt-record={{ domain }},"v=spf1 mx a -all"
|
txt-record={{ domain }},"v=spf1 mx a -all"
|
||||||
mx-host={{ domain }},{{ domain }},5
|
mx-host={{ domain }},{{ domain }},5
|
||||||
srv-host=_xmpp-client._tcp.{{ domain }},{{ domain }},5222,0,5
|
srv-host=_xmpp-client._tcp.{{ domain }},{{ domain }},5222,0,5
|
||||||
|
|
Loading…
Add table
Reference in a new issue