Skip to content

Instantly share code, notes, and snippets.

@mpasternacki
Created October 13, 2009 18:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mpasternacki/209446 to your computer and use it in GitHub Desktop.
Save mpasternacki/209446 to your computer and use it in GitHub Desktop.
Ping FCGI server, using cgi-fcgi program from libfcgi library.
#!/bin/sh
set -e
# Ping FCGI server. Uses cgi-fcgi program from libfcgi library.
# Retrieves the root path (/) from host:port specified on command line.
if [ -z "$1" ] ; then
echo "Usage: $0 host:port|path/to/socket" >&2
exit 1
fi
exec env \
REQUEST_METHOD=GET \
SERVER_NAME=localhost \
SERVER_PORT=8000 \
SERVER_PROTOCOL=HTTP/1.0 \
PATH_INFO=/ \
cgi-fcgi -bind -connect $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment