remove.inc 948 B

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