Skip to content

Commit 0f94601

Browse files
committed
[bug-gh-71] modified netcat loop to a curl loop
1 parent ee0425d commit 0f94601

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

edrop-cron.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ DJANGODIR=/edrop # Django project directory
55
NUM_WORKERS=3 # Number of Gunicorn workers
66
DJANGO_SETTINGS_MODULE=edrop.settings # Django settings module
77
DJANGO_WSGI_MODULE=edrop.wsgi # WSGI module name
8-
URL=127.0.0.1 # URL to ping before starting cron job
9-
PORT=8000 # Port to ping before starting cron job
108

119
echo "Starting $NAME as `whoami`"
1210

@@ -17,7 +15,15 @@ export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
1715
export PYTHONPATH=$DJANGODIR:$PYTHONPATH
1816
mkdir -p /edrop/logs
1917

20-
while ! nc -z $URL $PORT; do echo "eDrop not responding"; sleep 5; done
18+
while true; do
19+
sleep 5;
20+
http_response=$(curl -s -o /dev/null -I -w "%{http_code}\n" http://localhost:8000/$APP_ROOT);
21+
if [ $http_response == "200" ]; then
22+
break
23+
else
24+
echo "eDrop not responding"
25+
fi
26+
done
2127
echo "eDrop has started successfully"
2228

2329
# start the cron job

0 commit comments

Comments
 (0)