Index: trunk/pstamp/scripts/pstampwebrequest.sh
===================================================================
--- trunk/pstamp/scripts/pstampwebrequest.sh	(revision 16280)
+++ trunk/pstamp/scripts/pstampwebrequest.sh	(revision 16283)
@@ -12,4 +12,8 @@
 #
 # Note: there's nothing really web specific about this program.
+#       with the exception that we set up the environment to allow a 
+#       random user (in this case apache ) to run ipp programs
+#
+# TODO: re-write this in perl
 #
 ###
@@ -42,5 +46,4 @@
 
 # These variables need to be customized for a particular installation
-BASE_DIR=/export/data1/bills/pstamp
 export PSCONFDIR=/export/data0/bills/psconfig
 
@@ -48,8 +51,9 @@
 export LD_LIBRARY_PATH=/usr/local/lib
 
+WORK_DIR=/export/data1/bills/pstamp/work
+CMD_DIR=/export/data0/bills/src/ipp/pstamp/scripts
+
 #### END LOCAL_CONFIGURATION
 
-WORK_DIR=$BASE_DIR/work
-CMD_DIR=$BASE_DIR/bin
 export HOME=$WORK_DIR
 
@@ -67,9 +71,15 @@
 
 
-## configure IPP
+###
+### configure IPP
+###
 export MANPATH=""
 
 source $PSCONFDIR/psconfig.bash default
 
+###
+### Add our command directory to the path. This won't be necessary once the scripts get
+### installed in the IPP
+###
 PATH=${CMD_DIR}:${PATH}
 
@@ -149,7 +159,10 @@
 
 ###
-### TODO: Won't it interfere with pantask's job processing?
-###
-### Queue jobs for the request
+### TODO: Until we have pantasks monitoring the reuest and job table
+### run things directly
+
+
+###
+### Queue the jobs for the request
 ###
 pstampparser_run.pl $request_id  1> $parse_out 2> $parse_err
@@ -166,22 +179,19 @@
 fi
 
-cat $parse.out
-
-### for each line in the output add a psJob to the 
-
 ###
 ### Ok now it's time to build the stamps
+###
 
 stamp_out=stamp.${out_ext}
 stamp_err=stamp.${err_ext}
 
-echo making stamps > $stamp_err
-
-###
-### Make the stamps
+echo making stamps for request> $stamp_err
+
+###
+### Make the stamps by executing each of the jobs
 ###
 pstamp_dorequest.pl $request_id 1>$stamp_out 2>>$stamp_err
 if [[ $? != 0 ]]; then
-    echo makestamps.pl failed
+    echo pstamp_do_request.pl failed
     echo STDERR:
     cat $stamp_err
@@ -192,7 +202,6 @@
 fi
 
-# Success print the output
-# get the stamp urls
-cat $stamp_out
+# Success print the urls
+pstamptool -listjob -req_id $request_id -simple | awk '{ print $6 ".fits" }'
 
 cleanup
