remove.inc 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. hestia_module_awstats_remove() {
  3. source $HESTIA/bin/module/func.inc
  4. module_installed=$(hestia_module_isinstalled webstats)
  5. if [ ! "$module_installed" ] && [ ! "$param_force" ]; then
  6. echo "Web stats module is not installed. See 'hestia module info webstats'."
  7. exit 1
  8. fi
  9. module_variant=$(hestia_module_getvariant webstats)
  10. if [ "$module_variant" != 'awstats' ] && [ ! "$param_force" ]; then
  11. echo "The installed web stats module is not Awstats. See 'hestia module info webstats'."
  12. exit 1
  13. fi
  14. echo "Removing web stats (Awstats) module..."
  15. hestia_config_backup 'awstats-remove' $OSAL_PATH_AWSTATS_CONF
  16. osal_package_remove $OSAL_PKG_AWSTATS
  17. rm -rf $OSAL_PATH_AWSTATS_CONF
  18. osal_kv_write $HESTIA/conf/hestia.conf 'WEBSTATS_SYSTEM' 'no'
  19. osal_kv_write $HESTIA_CONF_MODULES/webstats.conf 'installed' '0'
  20. osal_kv_write $HESTIA_CONF_MODULES/webstats.conf 'description' ''
  21. osal_kv_write $HESTIA_CONF_MODULES/webstats.conf 'enabled' '0'
  22. osal_kv_write $HESTIA_CONF_MODULES/webstats.conf 'variant' ''
  23. osal_kv_write $HESTIA_CONF_MODULES/webstats.conf 'version' '0'
  24. exit 0
  25. }