From cad8a138fe090fa1dccf07a3c38072efafa934cc Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 4 Apr 2016 17:16:13 -0300 Subject: [PATCH] Recupera IP dinamico para rodar gunicorn simples --- simple_gunicorn.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simple_gunicorn.sh b/simple_gunicorn.sh index 82530bc50..673ff526f 100755 --- a/simple_gunicorn.sh +++ b/simple_gunicorn.sh @@ -7,4 +7,7 @@ source ~/.virtualenvs/sapl/bin/activate export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE export PYTHONPATH=$DJANGODIR:$PYTHONPATH -gunicorn --bind 10.1.2.119:8000 sapl.wsgi:application +# Get eth0 IP and filter out the netmask portion (/24, e.g.) +IP=`ip addr | grep 'inet .* eth0' | awk '{print $2}' | sed 's/\/[0-9]*//'` + +gunicorn --bind $IP:8000 sapl.wsgi:application