mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
ynh_add_config keep config panel settings
This commit is contained in:
parent
6278c68586
commit
08bcfe9daf
1 changed files with 11 additions and 0 deletions
|
@ -496,6 +496,11 @@ ynh_add_config() {
|
||||||
ynh_die --message="The provided template $template doesn't exist"
|
ynh_die --message="The provided template $template doesn't exist"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Backup variables handled by the config panel
|
||||||
|
local configpanel_backup_path
|
||||||
|
configpanel_backup_path="$(mktemp)"
|
||||||
|
yunohost app config get $app --export > "$configpanel_backup_path"
|
||||||
|
|
||||||
ynh_backup_if_checksum_is_different --file="$destination"
|
ynh_backup_if_checksum_is_different --file="$destination"
|
||||||
|
|
||||||
# Make sure to set the permissions before we copy the file
|
# Make sure to set the permissions before we copy the file
|
||||||
|
@ -513,6 +518,12 @@ ynh_add_config() {
|
||||||
ynh_replace_vars --file="$destination"
|
ynh_replace_vars --file="$destination"
|
||||||
|
|
||||||
ynh_store_file_checksum --file="$destination"
|
ynh_store_file_checksum --file="$destination"
|
||||||
|
|
||||||
|
# Restore variables handled by the config panel
|
||||||
|
yunohost app config set $app -f "$configpanel_backup_path"
|
||||||
|
ynh_secure_remove --file="$configpanel_backup_path"
|
||||||
|
ynh_store_file_checksum --file="$destination"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Replace variables in a file
|
# Replace variables in a file
|
||||||
|
|
Loading…
Add table
Reference in a new issue