remove 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. #=================================================
  3. # GENERIC START
  4. #=================================================
  5. # IMPORT GENERIC HELPERS
  6. #=================================================
  7. source _common.sh
  8. source /usr/share/yunohost/helpers
  9. #=================================================
  10. # LOAD SETTINGS
  11. #=================================================
  12. app=$YNH_APP_INSTANCE_NAME
  13. domain=$(ynh_app_setting_get "$app" domain)
  14. db_name=$(ynh_app_setting_get $app db_name)
  15. db_user=$db_name
  16. final_path=$(ynh_app_setting_get $app final_path)
  17. #=================================================
  18. # STANDARD REMOVE
  19. #=================================================
  20. # REMOVE THE MYSQL DATABASE
  21. #=================================================
  22. # Remove a database if it exists, along with the associated user
  23. ynh_mysql_remove_db $db_user $db_name
  24. #=================================================
  25. # REMOVE APP MAIN DIR
  26. #=================================================
  27. # Remove the app directory securely
  28. ynh_secure_remove "$final_path"
  29. #=================================================
  30. # REMOVE NGINX CONFIGURATION
  31. #=================================================
  32. # Remove the dedicated nginx config
  33. ynh_remove_nginx_config
  34. #=================================================
  35. # REMOVE PHP-FPM CONFIGURATION
  36. #=================================================
  37. # Remove the dedicated php-fpm config
  38. ynh_remove_fpm_config
  39. #=================================================
  40. # GENERIC FINALIZATION
  41. #=================================================
  42. # REMOVE DEDICATED USER
  43. #=================================================
  44. # Delete a system user
  45. ynh_system_user_delete $app