mirror of
https://github.com/YunoHost-Apps/z-push_ynh.git
synced 2024-09-03 18:05:58 +02:00
Keep conf files during upgrades >_>
This commit is contained in:
parent
9b56411c76
commit
77a15b6e28
1 changed files with 34 additions and 14 deletions
|
@ -26,11 +26,31 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|||
then
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
|
||||
mkdir "$install_dir/bkp"
|
||||
conf_files_to_keep="backend/caldav/config.php backend/carddav/config.php backend/imap/config.php backend/combined/config.php autodiscover/config.php backend/searchldap/config.php"
|
||||
for file in $conf_files_to_keep
|
||||
do
|
||||
if [ -e $install_dir/$file ]
|
||||
then
|
||||
mkdir -p $install_dir/bkp/$(dirname $file)
|
||||
cp $install_dir/$file $install_dir/bkp/$file
|
||||
fi
|
||||
done
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
mkdir "$install_dir/tmp"
|
||||
ynh_setup_source --dest_dir="$install_dir/tmp"
|
||||
cp -af "$install_dir/tmp/src/." "$install_dir/."
|
||||
ynh_secure_remove --file="$install_dir/tmp"
|
||||
|
||||
for file in $conf_files_to_keep
|
||||
do
|
||||
if [ -e $install_dir/bkp/$file ]
|
||||
then
|
||||
cp $install_dir/bkp/$file $install_dir/$file
|
||||
fi
|
||||
done
|
||||
ynh_secure_remove --file="$install_dir/bkp"
|
||||
fi
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
|
|
Loading…
Add table
Reference in a new issue