remove 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. #=================================================
  3. # IMPORT GENERIC HELPERS
  4. #=================================================
  5. source _common.sh
  6. source /usr/share/yunohost/helpers
  7. #=================================================
  8. # REMOVE SYSTEM CONFIGURATIONS
  9. #=================================================
  10. ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
  11. ynh_exec_warn_less yunohost user delete $zabbix_username --purge
  12. # need remove pinning
  13. ynh_secure_remove --file="/etc/apt/preferences.d/zabbix_repo"
  14. # Remove the dedicated systemd config
  15. ynh_systemd_action --service_name="$app-server" --action="stop" --log_path="/var/log/$app/${app}_server.log"
  16. ynh_systemd_action --service_name="$app-agent" --action="stop" --log_path="/var/log/$app/${app}_agent.log"
  17. systemctl disable zabbix-server --quiet
  18. systemctl disable zabbix-agent --quiet
  19. ynh_exec_warn_less killall zabbix_server
  20. ynh_exec_warn_less killall zabbix_agentd
  21. yunohost service remove snmpd
  22. yunohost service remove zabbix-server
  23. yunohost service remove zabbix-agent
  24. ynh_exec_warn_less yunohost user delete $zabbix_username --purge
  25. ynh_remove_nginx_config
  26. ynh_remove_fpm_config
  27. # Remove other various files specific to the app... such as:
  28. delete_initZabbixConf
  29. ynh_secure_remove --file="/usr/share/$app"
  30. ynh_secure_remove --file="/etc/$app"
  31. ynh_secure_remove --file="/run/$app"
  32. ynh_secure_remove --file="/etc/sudoers.d/$app"
  33. ynh_secure_remove --file="/usr/share/zabbix-cli"
  34. #=================================================
  35. # END OF SCRIPT
  36. #=================================================
  37. ynh_script_progression --message="Removal of $app completed"