1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00

Update upgrade

This commit is contained in:
ericgaspar 2021-06-02 09:39:51 +02:00
parent d3f3639581
commit f476887824
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -80,27 +80,27 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=2 ynh_script_progression --message="Upgrading source files..." --weight=2
# Create a temporary directory # # Create a temporary directory
tmpdir="$(mktemp -d)" # tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir # # Backup the config file in the temp dir
cp -ar "$final_path/groups" "$tmpdir/groups" # cp -ar "$final_path/groups" "$tmpdir/groups"
cp -ar "$final_path/data/passwd" "$tmpdir/passwd" # cp -ar "$final_path/data/passwd" "$tmpdir/passwd"
# Remove the app directory securely # # Remove the app directory securely
ynh_secure_remove --file="$final_path" # ynh_secure_remove --file="$final_path"
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" --keep="$final_path/groups $final_path/data/passwd"
# Create data and groups folder # # Create data and groups folder
mkdir -p "$final_path/data" "$final_path/groups" # mkdir -p "$final_path/data" "$final_path/groups"
# Copy the admin saved settings from tmp directory to final path # # Copy the admin saved settings from tmp directory to final path
cp -ar "$tmpdir/groups" "$final_path/groups" # cp -ar "$tmpdir/groups" "$final_path/groups"
cp -ar "$tmpdir/passwd" "$final_path/data/passwd" # cp -ar "$tmpdir/passwd" "$final_path/data/passwd"
# Remove the tmp directory securely # # Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir" # ynh_secure_remove --file="$tmpdir"
fi fi
chmod 750 "$final_path" chmod 750 "$final_path"