1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00

Update upgrade

This commit is contained in:
Éric Gaspar 2024-02-11 23:05:18 +01:00
parent 41801be48d
commit e29d286468

View file

@ -16,44 +16,29 @@ then
ynh_app_setting_set --app=$app --key=password --value="$password"
fi
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..." --weight=3
# Get rid of legacy symlinks
[ -L "$install_dir/_data" ] && ynh_secure_remove "$install_dir/_data" || true
[ -L "$install_dir/galleries" ] && ynh_secure_remove "$install_dir/galleries" || true
[ -L "$install_dir/upload" ] && ynh_secure_remove "$install_dir/upload" || true
ynh_setup_source --dest_dir="$install_dir"
ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin
ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin
if [ "$upgrade_type" == "UPGRADE_APP" ]
# We don't want to keep those in the install dir, they already are in $data_dir
if [ -d "$install_dir/_data" ] && [ ! -L "$install_dir/_data" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=3
ynh_setup_source --dest_dir="$install_dir"
ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin
ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin
# We don't want to keep those in the install dir, they already are in $data_dir
if [ -d "$install_dir/_data" ] && [ ! -L "$install_dir/_data" ]
then
ynh_secure_remove "$install_dir/_data"
fi
if [ -d "$install_dir/galleries" ] && [ ! -L "$install_dir/galleries" ]
then
ynh_secure_remove "$install_dir/galleries"
fi
if [ -d "$install_dir/upload" ] && [ ! -L "$install_dir/upload" ]
then
ynh_secure_remove "$install_dir/upload"
fi
ynh_secure_remove "$install_dir/_data"
fi
if [ -d "$install_dir/galleries" ] && [ ! -L "$install_dir/galleries" ]
then
ynh_secure_remove "$install_dir/galleries"
fi
if [ -d "$install_dir/upload" ] && [ ! -L "$install_dir/upload" ]
then
ynh_secure_remove "$install_dir/upload"
fi
chmod 750 "$data_dir"
chmod -R o-rwx "$data_dir"