1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/archivist_ynh.git synced 2024-09-03 18:15:55 +02:00

use ynh_add_config for Backup_list

This commit is contained in:
lapineige 2023-12-31 12:42:35 +01:00 committed by GitHub
parent 8437d6ff73
commit 69c2ea1019
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,10 +91,6 @@ mkdir -p "$backup_dir"
ynh_script_progression --message="Configuring Archivist..." --weight=2
config_file="$final_path/Backup_list.conf"
cp "$final_path/Backup_list.conf.default" "$config_file"
ynh_replace_string --match_string="^backup_dir=.*" --replace_string="backup_dir=$backup_dir" --target_file="$config_file"
ynh_replace_string --match_string="^enc_backup_dir=.*" --replace_string="enc_backup_dir=$enc_backup_dir" --target_file="$config_file"
if [ $encrypt -eq 1 ]
then
@ -107,8 +103,7 @@ else
encrypt=false
passkey=na
fi
ynh_replace_string --match_string="^encrypt=.*" --replace_string="encrypt=$encrypt" --target_file="$config_file"
ynh_replace_string --match_string="^cryptpass=.*" --replace_string="cryptpass=$passkey" --target_file="$config_file"
if [ $core_backup -eq 1 ]
then
@ -116,7 +111,8 @@ then
else
core_backup=false
fi
ynh_replace_string --match_string="^ynh_core_backup=.*" --replace_string="ynh_core_backup=$core_backup" --target_file="$config_file"
ynh_add_config --template="Backup_list.conf.default" --destination="$config_file"
if [ $apps_backup -eq 1 ]
then