mirror of
https://github.com/YunoHost-Apps/bookstack_ynh.git
synced 2024-09-03 18:16:02 +02:00
36c2151a39
* restart config panel * Update manifest.toml * Standard (#119) * fix * Update manifest.toml * Update manifest.toml * Update POST_INSTALL.md * Update POST_INSTALL_fr.md * fix * Update manifest.toml * Auto-update README * Update tests.toml * Update tests.toml * remove standard * Update manifest.toml * Auto-update README * Update tests.toml * Update manifest.toml * Update manifest.toml * Update install * Update manifest.toml * Auto-update README * Update manifest.toml * Auto-update README * cleaning * Update manifest.toml * Auto-update README * Update manifest.toml * Auto-update README * Upgrade to v23.6.2 (#128) * Upgrade to v23.6.2 * Auto-update README * Auto-update README * Update manifest.toml * Add maintenance * Update config_panel.toml * Update config * Update config_panel.toml * Update config * Update manifest.toml * Update config * Update config * fix * Update manifest.toml * Auto-update README * Update manifest.toml * Auto-update README * Update manifest.toml * Auto-update README * Update manifest.toml * Update manifest.toml * Auto-update README * Update manifest.toml * Auto-update README * Mail (#139) * fix mail * Auto-update README * Update .env.example * Update .env.example * Update .env.example * Update .env.example * Update .env.example --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> * Update manifest.toml * Auto-update README * Update manifest.toml * Update install * fix * fix * Auto-update README * Update systemd.service --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com>
64 lines
2.4 KiB
Bash
64 lines
2.4 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source ../settings/scripts/_common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# RESTORE THE APP MAIN DIR
|
|
#=================================================
|
|
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
|
|
|
ynh_restore_file --origin_path="$install_dir"
|
|
|
|
# Restore permissions on app files
|
|
chmod -R o-rwx $install_dir
|
|
chmod -R 775 $install_dir/storage $install_dir/bootstrap/cache $install_dir/public/uploads
|
|
chown -R $app:www-data $install_dir
|
|
chmod 640 $install_dir/.env
|
|
|
|
#=================================================
|
|
# 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 THE PHP-FPM CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
|
|
|
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
|
|
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
|
systemctl enable $app.service --quiet
|
|
|
|
yunohost service add $app --description="BookStack Queue Worker" --log="/var/log/$app/$app.log"
|
|
|
|
#=================================================
|
|
# GENERIC FINALIZATION
|
|
#=================================================
|
|
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
|
|
|
|
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
|
ynh_systemd_action --service_name=nginx --action=reload
|
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Restoration completed for $app" --last
|