Skip to content
Snippets Groups Projects
Select Git revision
  • master
1 result

bootstrap-grid.css

Blame
  • check_django.sh 548 B
    #!/bin/bash
    set -e
    
    # Django does not allow request on "localhost" in production, so we have to
    # override curls resolver and use the public name.
    TARGET=${1:-$DJANGO_HOST}
    if [[ -z "$TARGET" ]]; then
    	echo "Usage: check_django <hostname> (or provide DJANGO_HOST env variable)";
    	exit 1;
    fi
    
    response="$(curl --silent --show-error --fail-with-body --unix-socket /run/hub/app.sock --resolve "${TARGET}:80:127.0.0.1" "http://${TARGET}${SCRIPT_NAME}/.well-known/health")"
    echo "$response"
    
    if [[ "$response" == "OK" ]]; then
    	exit 0;
    else
    	exit 1;
    fi