Skip to content

Instantly share code, notes, and snippets.

@perusio
Forked from mpasternacki/pingfcgi.sh
Created January 15, 2012 19:31
Show Gist options
  • Save perusio/1616933 to your computer and use it in GitHub Desktop.
Save perusio/1616933 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