2
0

remove 2.1 KB

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