remove 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. #=================================================
  3. # IMPORT GENERIC HELPERS
  4. #=================================================
  5. source _common.sh
  6. source /usr/share/yunohost/helpers
  7. ### Settings are automatically loaded as bash variables
  8. ### in every app script context, therefore typically these will exist:
  9. ### - $domain
  10. ### - $path
  11. ### - $language
  12. ### - $install_dir
  13. ### - $port
  14. ### ...
  15. ### For remove operations:
  16. ### - the core will deprovision every resource defined in the manifest **after** this script is ran
  17. ### this includes removing the install directory, and data directory (if --purge was used)
  18. #=================================================
  19. # REMOVE SYSTEM CONFIGURATION
  20. #=================================================
  21. ynh_script_progression "Removing system configurations related to $app..."
  22. ### This should be a symetric version of what happens in the install script
  23. ynh_config_remove_fail2ban
  24. ynh_config_remove_logrotate
  25. # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
  26. if ynh_hide_warnings yunohost service status "$app" >/dev/null; then
  27. yunohost service remove "$app"
  28. fi
  29. ynh_config_remove_systemd
  30. ynh_config_remove_nginx
  31. ynh_config_remove_phpfpm
  32. # Remove other various files specific to the app... such as:
  33. ynh_safe_rm "/etc/cron.d/$app"
  34. ynh_safe_rm "/etc/$app"
  35. #=================================================
  36. # END OF SCRIPT
  37. #=================================================
  38. ynh_script_progression "Removal of $app completed"