1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cac-proxy_ynh.git synced 2024-09-03 18:16:07 +02:00

Better fix by creating expected file

This commit is contained in:
Gérard Collin 2023-09-28 11:28:10 +02:00
parent 4b0c0c1745
commit cf01d3f9ab

View file

@ -38,9 +38,11 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
# There is an issue in previous backup file in case of non public_key, so backup only in case of public_key
if [ -n "$public_key" ]
# There is an issue in previous backup file in case of non public_key, so we create the missing directory
if [ ! -f "/etc/sudoers.d/$app-sudoers" ]
then
touch "/etc/sudoers.d/$app-sudoers"
fi
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
@ -50,6 +52,11 @@ then
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Removes the directory created only for backup if not necessary
if [ ! -n "$public_key" ]
then
rm "/etc/sudoers.d/$app-sudoers"
fi
# Exit if an error occurs during the execution of the script