1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ampache_ynh.git synced 2024-09-03 18:15:55 +02:00
This commit is contained in:
Éric Gaspar 2023-08-29 21:27:56 +02:00
parent 2646f4e1d8
commit 7918600d27
2 changed files with 10 additions and 9 deletions

View file

@ -20,6 +20,13 @@ ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=2
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
@ -35,13 +42,6 @@ mkdir -p "/var/log/$app"
chown $app: "/var/log/$app" chown $app: "/var/log/$app"
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=2
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -72,9 +72,9 @@ fi
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1 #ynh_script_progression --message="Updating a configuration file..." --weight=1
(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/cli admin:updateDatabase -e) #(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/cli admin:updateDatabase -e)
#ynh_add_config --template="../conf/ampache.cfg.php" --destination="$install_dir/config/ampache.cfg.php" #ynh_add_config --template="../conf/ampache.cfg.php" --destination="$install_dir/config/ampache.cfg.php"
@ -96,6 +96,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_local_curl /update.php?action=update ynh_local_curl /update.php?action=update
sleep 1 sleep 1
(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/cli admin:updateDatabase -e)
fi fi
#================================================= #=================================================