remove.inc 1.4 KB

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