forked from stove/dataset
18 lines
668 B
SYSTEMD
18 lines
668 B
SYSTEMD
|
%set %%domains = []
|
||
|
%for %%domainname in %%revprox_domainnames_all
|
||
|
%set %%family = %%normalize_family(%%domainname)
|
||
|
%set %%revprox = %%nginx['reverse_proxy_for_' + family]['reverse_proxy_' + family]
|
||
|
%for %%location in %%revprox['revprox_location_' + family]
|
||
|
%set %%domain = %%location['revprox_url_' + family].split('/', 3)[2].split(':')[0]
|
||
|
%%domains.append(%%domain)%slurp
|
||
|
%end for
|
||
|
%end for
|
||
|
%if %%domains
|
||
|
%set %%domains_str = " ".join(%%domains)
|
||
|
[Service]
|
||
|
ExecStartPre=
|
||
|
ExecStartPre=/usr/bin/timeout 90 sh -c 'while ! /usr/bin/resolvectl query %%domains_str; do sleep 1; done'
|
||
|
ExecStartPre=/usr/bin/rm -f /run/nginx.pid
|
||
|
ExecStartPre=/usr/sbin/nginx -t
|
||
|
%end if
|