remove.inc 992 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. hestia_module_nginx_remove() {
  3. source $HESTIA/bin/module/func.inc
  4. module_installed=$(hestia_module_isinstalled nginx)
  5. if [ ! "$module_installed" ] && [ ! "$param_force" ]; then
  6. echo "Nginx module is not installed. See 'hestia module info nginx'."
  7. exit 1
  8. fi
  9. echo "Removing Nginx module..."
  10. osal_service_stop $OSAL_SERVICE_NGINX > /dev/null 2>&1
  11. osal_service_disable $OSAL_SERVICE_NGINX > /dev/null 2>&1
  12. hestia_config_backup 'nginx-remove' $OSAL_PATH_NGINX_CONF
  13. osal_package_remove $OSAL_PKG_NGINX
  14. osal_kv_write $HESTIA_CONF_MODULES/nginx.conf 'installed' '0'
  15. osal_kv_write $HESTIA_CONF_MODULES/nginx.conf 'description' ''
  16. osal_kv_write $HESTIA_CONF_MODULES/nginx.conf 'enabled' '0'
  17. osal_kv_write $HESTIA_CONF_MODULES/nginx.conf 'variant' ''
  18. osal_kv_write $HESTIA_CONF_MODULES/nginx.conf 'version' '0'
  19. # Setup web module (depending on Nginx and/or Apache config)
  20. $BIN/hestia module web setup
  21. }