restore 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #chmod -R o-rwx "$install_dir"
  10. #chown -R $app:www-data "$install_dir"
  11. #=================================================
  12. # REINSTALL DEPENDENCIES
  13. #=================================================
  14. ynh_script_progression "Reinstalling dependencies..."
  15. ynh_nodejs_install
  16. #=================================================
  17. # RESTORE SYSTEM CONFIGURATIONS
  18. #=================================================
  19. ynh_script_progression "Restoring system configurations related to $app..."
  20. ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
  21. ynh_restore "/etc/systemd/system/$app.service"
  22. systemctl enable $app.service --quiet
  23. yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
  24. #=================================================
  25. # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
  26. #=================================================
  27. ynh_script_progression "Reloading NGINX web server and $app's service..."
  28. ynh_systemctl --service=$app --action="start" --log_path="systemd"
  29. ynh_systemctl --service=nginx --action=reload
  30. #=================================================
  31. # END OF SCRIPT
  32. #=================================================
  33. ynh_script_progression "Restoration completed for $app"