restore 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. source ../settings/scripts/_common.sh
  3. source /usr/share/yunohost/helpers
  4. #=================================================
  5. # RESTORE THE APP MAIN DIR
  6. #=================================================
  7. ynh_script_progression "Restoring the app main directory..."
  8. ynh_restore "$install_dir"
  9. #=================================================
  10. # REINSTALL DEPENDENCIES
  11. #=================================================
  12. ynh_script_progression "Reinstalling dependencies..."
  13. ynh_nodejs_install
  14. #=================================================
  15. # RESTORE SYSTEM CONFIGURATIONS
  16. #=================================================
  17. ynh_script_progression "Restoring system configurations related to $app..."
  18. ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
  19. ynh_restore "/etc/systemd/system/$app.service"
  20. systemctl enable $app.service --quiet
  21. yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
  22. #=================================================
  23. # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
  24. #=================================================
  25. ynh_script_progression "Reloading NGINX web server and $app's service..."
  26. ynh_systemctl --service=$app --action="start" --log_path="systemd"
  27. ynh_systemctl --service=nginx --action=reload
  28. #=================================================
  29. # END OF SCRIPT
  30. #=================================================
  31. ynh_script_progression "Restoration completed for $app"