remove.inc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. clamav_installed=$(hestia_module_variant_installed 'antivirus' 'clamav')
  15. if [ "$clamav_installed" ]; then
  16. $BIN/hestia module clamav exim-integration disable
  17. fi
  18. spamassassin_installed=$(hestia_module_variant_installed 'antispam' 'spamassassin')
  19. if [ "$spamassassin_installed" ]; then
  20. $BIN/hestia module spamassassin exim-integration disable
  21. fi
  22. osal_service_stop $OSAL_SERVICE_EXIM > /dev/null 2>&1
  23. osal_service_disable $OSAL_SERVICE_EXIM > /dev/null 2>&1
  24. hestia_config_backup 'exim-remove' "$OSAL_DIR_EXIM_CONF"
  25. osal_package_remove $OSAL_PKG_EXIM
  26. osal_kv_write $HESTIA/conf/hestia.conf 'MAIL_SYSTEM' ''
  27. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'installed' '0'
  28. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'description' ''
  29. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'enabled' '0'
  30. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'variant' ''
  31. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'version' '0'
  32. }