remove.inc 1.1 KB

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