remove.inc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. hestia_module_spamassassin_remove() {
  3. source $HESTIA/bin/module/func.inc
  4. if ! hestia_module_isinstalled 'antispam' && [ ! "$param_force" ]; then
  5. echo "Antispam module is not installed. See 'hestia module info antispam'."
  6. return 1
  7. fi
  8. module_variant=$(hestia_module_getvariant antispam)
  9. if [ "$module_variant" != 'spamassassin' ] && [ ! "$param_force" ]; then
  10. echo "The installed antispam module is not SpamAssassin. See 'hestia module info antispam'."
  11. return 1
  12. fi
  13. echo "Removing antispam (SpamAssassin) module..."
  14. if hestia_module_variant_installed 'mta' 'exim'; then
  15. $BIN/hestia module spamassassin exim-integration disable
  16. fi
  17. osal_service_stop $OSAL_SERVICE_SPAMASSASSIN > /dev/null 2>&1
  18. osal_service_disable $OSAL_SERVICE_SPAMASSASSIN > /dev/null 2>&1
  19. hestia_config_backup 'spamassassin-remove' $OSAL_PATH_SPAMASSASSIN_CONF
  20. osal_package_remove $OSAL_PKG_SPAMASSASSIN
  21. hestia_safe_rm $OSAL_PATH_SPAMASSASSIN_CONF
  22. osal_kv_write $HESTIA/conf/hestia.conf 'ANTISPAM_SYSTEM' ''
  23. osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'installed' '0'
  24. osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'description' ''
  25. osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'enabled' '0'
  26. osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'variant' ''
  27. osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'version' '0'
  28. return 0
  29. }