What is a wrapper script?

Steven Monai stevem at SPATIALMAPPING.COM
Thu Jan 26 12:02:40 EST 2006


Liang:

I haved used the following shell script on a Linux box (although it should
be generic enough to run on any OS with /bin/sh):

#!/bin/sh
MAPSERV="/path/to/my/mapserv"
MAPFILE="/path/to/my/mapfile.map"
if [ "${REQUEST_METHOD}" = "GET" ]; then
  if [ -z "${QUERY_STRING}" ]; then
    QUERY_STRING="map=${MAPFILE}"
  else
    QUERY_STRING="map=${MAPFILE}&${QUERY_STRING}"
  fi
  exec ${MAPSERV}
else
  echo "Sorry, I only understand GET requests."
fi
exit 1
# End of Script

You should set the MAPSERV and MAPFILE variables as appropriate for your
configuration. Then put the script in your web server's cgi-bin directory,
and make it executable.

I haven't ever needed POST capability, so I can't tell you offhand how to
modify the script to handle POST requests. Maybe someone else can chime in
with the solution.

Hope this helps,
-SM
--



On Thu, 26 Jan 2006 02:13:36 +0800, =?gb2312?B?194gwcE=?= <lltous at MSN.COM>
wrote:

>hi everyone,
>
>I don't know how to create a simple wrapper script to hide the map=
>parameter. Would you please give me some clues about the wrapper script?
>How can I create one? Is there a tool to create it?
>
>Thank you very much.
>
>Liang
>
>_________________________________________________________________
>Ãâ·ÑÏÂÔØ MSN Explorer:   http://explorer.msn.com/lccn



More information about the mapserver-users mailing list