remove.inc 1.5 KB

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