1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/navidrome_ynh.git synced 2024-09-03 19:46:30 +02:00

Remove the config file reset

This commit is contained in:
ericgaspar 2020-08-19 12:45:10 +02:00
parent a7fd08abc0
commit 8b3ac2811f
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -60,12 +60,23 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=5
# # Create a temporary directory
# tmpdir="$(mktemp -d)"
# # Backup the config file in the temp dir
# cp -a "/var/lib/$app/navidrome.toml" "$tmpdir/navidrome.toml"
# Remove the app directory securely
ynh_secure_remove --file=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$final_path --source_id="$architecture"
# # Copy the admin saved settings from tmp directory to final config path
# cp -a "$tmpdir/navidrome.toml" "/var/lib/$app/navidrome.toml"
# # Remove the tmp directory securely
# ynh_secure_remove --file="$tmpdir"
fi
#=================================================
@ -104,21 +115,21 @@ ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Music" --dest_dir="sh
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying a config file..."
# ynh_script_progression --message="Modifying a config file..."
config_path="/var/lib/$app"
mkdir -p "$config_path"
# config_path="/var/lib/$app"
# mkdir -p "$config_path"
ynh_backup_if_checksum_is_different --file="$config_path/navidrome.toml"
# ynh_backup_if_checksum_is_different --file="$config_path/navidrome.toml"
cp ../conf/navidrome.toml "$config_path/navidrome.toml"
# cp ../conf/navidrome.toml "$config_path/navidrome.toml"
# Main config File
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/navidrome.toml"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config_path/navidrome.toml"
ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="$config_path/navidrome.toml"
# # Main config File
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/navidrome.toml"
# ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config_path/navidrome.toml"
# ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="$config_path/navidrome.toml"
ynh_store_file_checksum --file="$config_path/navidrome.toml"
# ynh_store_file_checksum --file="$config_path/navidrome.toml"
#=================================================
# SETUP SYSTEMD