remove 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. # Remove the dedicated systemd config
  12. ynh_systemd_action --service_name="$app-server" --action="stop" --log_path="/var/log/$app/${app}_server.log"
  13. ynh_systemd_action --service_name="$app-agent" --action="stop" --log_path="/var/log/$app/${app}_agent.log"
  14. systemctl disable zabbix-server --quiet
  15. systemctl disable zabbix-agent --quiet
  16. ynh_exec_warn_less killall zabbix_server
  17. ynh_exec_warn_less killall zabbix_agentd
  18. yunohost service remove snmpd
  19. yunohost service remove zabbix-server
  20. yunohost service remove zabbix-agent
  21. ynh_remove_nginx_config
  22. ynh_remove_fpm_config
  23. # Remove other various files specific to the app... such as:
  24. yunohost user delete $zabbix_username --purge
  25. # Remove config file detection
  26. delete_initZabbixConf
  27. ynh_secure_remove --file="/usr/share/$app"
  28. ynh_secure_remove --file="/etc/$app"
  29. ynh_secure_remove --file="/run/$app"
  30. ynh_secure_remove --file="/etc/sudoers.d/$app"
  31. ynh_secure_remove --file="/usr/share/zabbix-cli"
  32. #=================================================
  33. # END OF SCRIPT
  34. #=================================================
  35. ynh_script_progression --message="Removal of $app completed"