1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wekan_ynh.git synced 2024-09-03 20:36:09 +02:00
wekan_ynh/scripts/restore
Éric Gaspar 22bbb5ff27 cleaning
2024-08-29 14:21:36 +02:00

55 lines
1.7 KiB
Bash

#!/bin/bash
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression "Restoring the app main directory..."
ynh_restore "$install_dir"
#=================================================
# SPECIFIC RESTORATION
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression "Reinstalling dependencies..."
ynh_nodejs_install
#=================================================
# RESTORE THE MONGODB DATABASE
#=================================================
ynh_script_progression "Restoring the MongoDB database..."
ynh_install_mongo
ynh_mongo_restore_db < ./dump.bson
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression "Restoring the NGINX web server configuration..."
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore "/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
ynh_systemctl --service=$app --action="start" --log_path=systemd --wait_until="Enabling LDAP Background Sync"
ynh_systemctl --service=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Restoration completed for $app"