6 PYTHON_FILE_SERVER_ROOT="$TEMP_DIR/python-simple-http-webserver"
8 PORT=$(ctx node properties port)
9 URL="http://localhost:$PORT"
11 ctx logger info [ "Starting web server at: $PYTHON_FILE_SERVER_ROOT." ]
13 cd "$PYTHON_FILE_SERVER_ROOT"
14 nohup python -m SimpleHTTPServer "$PORT" > /dev/null 2>&1 &
18 if which wget >/dev/null; then
19 if wget "$URL" >/dev/null; then
22 elif which curl >/dev/null; then
23 if curl "$URL" >/dev/null; then
27 ctx logger error [ "Both curl and wget were not found in path." ]
33 ctx logger info [ "Waiting for web server to launch on port $PORT..." ]
38 ctx logger info [ "Web server is up." ]
42 ctx logger info [ "Web server not up. waiting 1 second." ]
47 if [ "$STARTED" = false ]; then
48 ctx logger error [ "Web server did not start within 15 seconds." ]