remove.inc 1.2 KB

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