remove.inc 1.5 KB

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