remove.inc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. hestia_module_dovecot_remove() {
  3. source $HESTIA/bin/module/func.inc
  4. module_installed=$(hestia_module_isinstalled imap)
  5. if [ ! "$module_installed" ] && [ ! "$param_force" ]; then
  6. echo "IMAP module is not installed. See 'hestia module info imap'."
  7. exit 1
  8. fi
  9. module_variant=$(hestia_module_getvariant imap)
  10. if [ "$module_variant" != 'dovecot' ] && [ ! "$param_force" ]; then
  11. echo "The installed IMAP module is not Dovecot. See 'hestia module info imap'."
  12. exit 1
  13. fi
  14. echo "Removing IMAP (Dovecot) module..."
  15. osal_service_stop $OSAL_SERVICE_DOVECOT > /dev/null 2>&1
  16. osal_service_disable $OSAL_SERVICE_DOVECOT > /dev/null 2>&1
  17. hestia_config_backup 'dovecot-remove' $OSAL_PATH_DOVECOT_CONF
  18. rm -rf $OSAL_PATH_DOVECOT_CONF
  19. osal_package_remove $OSAL_PKG_DOVECOT
  20. osal_kv_write $HESTIA/conf/hestia.conf 'IMAP_SYSTEM' 'no'
  21. osal_kv_write $HESTIA_CONF_MODULES/imap.conf 'installed' '0'
  22. osal_kv_write $HESTIA_CONF_MODULES/imap.conf 'description' ''
  23. osal_kv_write $HESTIA_CONF_MODULES/imap.conf 'enabled' '0'
  24. osal_kv_write $HESTIA_CONF_MODULES/imap.conf 'variant' ''
  25. osal_kv_write $HESTIA_CONF_MODULES/imap.conf 'version' '0'
  26. exit 0
  27. }