remove.inc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. hestia_module_clamav_remove() {
  3. source $HESTIA/bin/module/func.inc
  4. if ! hestia_module_isinstalled 'antivirus' && [ ! "$param_force" ]; then
  5. echo "antivirus module is not installed. See 'hestia module info antivirus'."
  6. return 0
  7. fi
  8. module_variant=$(hestia_module_getvariant antivirus)
  9. if [ "$module_variant" != 'clamav' ] && [ ! "$param_force" ]; then
  10. echo "The installed antivirus module is not ClamAV. See 'hestia module info antivirus'."
  11. return 1
  12. fi
  13. echo "Removing antivirus (ClamAV) module..."
  14. if [[ $(hestia_module_variant_installed 'mta') == 'exim' ]]; then
  15. hestia module clamav exim-integration disable
  16. fi
  17. osal_service_stop $OSAL_SERVICE_CLAMAV > /dev/null 2>&1
  18. osal_service_disable $OSAL_SERVICE_CLAMAV > /dev/null 2>&1
  19. hestia_config_backup 'clamav-remove' $OSAL_PATH_CLAMAV_CONF $OSAL_PATH_CLAMAV_CONF_D
  20. hestia_safe_rm $OSAL_PATH_CLAMAV_CONF $OSAL_PATH_CLAMAV_CONF_D
  21. osal_package_remove $OSAL_PKG_CLAMAV
  22. osal_kv_write $HESTIA/conf/hestia.conf 'ANTIVIRUS_SYSTEM' ''
  23. osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'installed' '0'
  24. osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'description' ''
  25. osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'enabled' '0'
  26. osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'variant' ''
  27. osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'version' '0'
  28. }