mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Various fixes on configuration regeneration
This commit is contained in:
parent
b615bcb810
commit
15533c7c6f
5 changed files with 11 additions and 11 deletions
|
@ -264,6 +264,7 @@ domain:
|
|||
action_help: Create a custom domain
|
||||
api: POST /domains
|
||||
configuration:
|
||||
lock: false
|
||||
authenticate: all
|
||||
arguments:
|
||||
domain:
|
||||
|
@ -282,6 +283,7 @@ domain:
|
|||
action_help: Delete domains
|
||||
api: DELETE /domains/<domain>
|
||||
configuration:
|
||||
lock: false
|
||||
authenticate: all
|
||||
arguments:
|
||||
domain:
|
||||
|
|
|
@ -63,8 +63,8 @@ for file in /etc/metronome/conf.d/*; do
|
|||
| sed 's|.cfg.lua||')
|
||||
sanitzed_domain="$(echo $domain | sed 's/\./%2e/g')"
|
||||
[[ $domain_list =~ $domain ]] \
|
||||
|| $(sudo yunohost service saferemove -s metronome $file) == "True" \
|
||||
&& rm -rf /var/lib/metronome/$sanitzed_domain
|
||||
|| ($(sudo yunohost service saferemove -s metronome $file) == "True" \
|
||||
&& rm -rf /var/lib/metronome/$sanitzed_domain)
|
||||
|
||||
done
|
||||
|
||||
|
|
|
@ -37,9 +37,10 @@ safe_copy yunohost_local.conf \
|
|||
|
||||
|
||||
need_restart=False
|
||||
domain_list=$(sudo yunohost domain list --raw)
|
||||
|
||||
# Copy a configuration file for each YunoHost domain
|
||||
for domain in $(sudo yunohost domain list --raw); do
|
||||
for domain in $domain_list; do
|
||||
sudo mkdir -p /etc/nginx/conf.d/$domain.d
|
||||
cat server.conf.sed \
|
||||
| sed "s/{{ domain }}/$domain/g" \
|
||||
|
@ -55,8 +56,8 @@ for file in /etc/nginx/conf.d/*.*.conf; do
|
|||
| sed 's|/etc/nginx/conf.d/||' \
|
||||
| sed 's|.conf||')
|
||||
[[ $domain_list =~ $domain ]] \
|
||||
|| $(sudo yunohost service saferemove -s nginx $file) == "True" \
|
||||
&& (rm -r /etc/nginx/conf.d/$domain.d || true)
|
||||
|| ($(sudo yunohost service saferemove -s nginx $file) == "True" \
|
||||
&& (rm -r /etc/nginx/conf.d/$domain.d || true))
|
||||
done
|
||||
|
||||
# Restart if need be
|
||||
|
|
|
@ -24,8 +24,10 @@ ipv6=$(ip route get 2000:: | grep -q "unreachable" && echo '' \
|
|||
|
||||
sudo mkdir -p /etc/dnsmasq.d
|
||||
|
||||
domain_list=$(sudo yunohost domain list --raw)
|
||||
|
||||
# Copy a configuration file for each YunoHost domain
|
||||
for domain in $(sudo yunohost domain list --raw); do
|
||||
for domain in $domain_list; do
|
||||
cat domain.sed \
|
||||
| sed "s/{{ domain }}/$domain/g" \
|
||||
| sed "s/{{ ip }}/$ip/g" \
|
||||
|
|
|
@ -466,11 +466,6 @@ def service_saferemove(service, conf_file, force=False):
|
|||
deleted = True
|
||||
msignals.display(m18n.n('service_configuration_backup', conf_backup_file),
|
||||
'info')
|
||||
elif keep:
|
||||
services[service]['conffiles'][conf_file] = \
|
||||
previous_hash[0:32] + ', but keep ' + current_hash
|
||||
msignals.display(m18n.n('service_configuration_backup', conf_backup_file),
|
||||
'info')
|
||||
else:
|
||||
services[service]['conffiles'][conf_file] = previous_hash
|
||||
os.remove(conf_backup_file)
|
||||
|
|
Loading…
Add table
Reference in a new issue