2
0

remove 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. ynh_script_progression --message="Load settings" --weight=2
  13. app=$YNH_APP_INSTANCE_NAME
  14. final_path=$(ynh_app_setting_get $app final_path)
  15. #=================================================
  16. # STANDARD REMOVE
  17. #=================================================
  18. # REMOVE DEPENDENCIES
  19. #=================================================
  20. ynh_script_progression --message="Remove dependencies" --weight=7
  21. # Remove metapackage and its dependencies
  22. ynh_remove_app_dependencies
  23. #=================================================
  24. # REMOVE APP MAIN DIR
  25. #=================================================
  26. ynh_script_progression --message="Remove app main directory"
  27. # Remove the app directory securely
  28. ynh_secure_remove "$final_path"
  29. #=================================================
  30. # REMOVE LOGROTATE CONFIGURATION
  31. #=================================================
  32. ynh_script_progression --message="Remove logrotate configuration"
  33. # Remove the app-specific logrotate config
  34. ynh_remove_logrotate
  35. #=================================================
  36. # SPECIFIC REMOVE
  37. #=================================================
  38. # REMOVE THE CRON FILE
  39. #=================================================
  40. # Remove a cron file
  41. ynh_secure_remove "/etc/cron.d/$app"
  42. ynh_script_progression --message="Remove backup directory" --weight=5
  43. # Remove the backup directory
  44. ynh_secure_remove "/home/yunohost.app/${app}/backup"
  45. #=================================================
  46. # END OF SCRIPT
  47. #=================================================
  48. ynh_script_progression --message="Deletion completed" --last