remove.inc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  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. osal_service_stop $OSAL_PKG_EXIM
  16. osal_service_disable $OSAL_PKG_EXIM
  17. hestia_config_backup 'exim-remove' $OSAL_PATH_EXIM_CONF
  18. osal_package_remove $OSAL_PKG_EXIM $OSAL_PKG_EXIM_DAEMON
  19. osal_kv_write $HESTIA/conf/hestia.conf 'MAIL_SYSTEM' 'no'
  20. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'installed' '0'
  21. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'description' ''
  22. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'enabled' '0'
  23. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'variant' ''
  24. osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'version' '0'
  25. exit 0
  26. }