updated and cleaned...
[feisty_meow.git] / scripts / database / call_show_stripper.sh
1 #!/bin/bash
2 # processes cgi request and passes it on to the real script.
3
4 show_name="$(echo $QUERY_STRING | sed -e "s/^[^=][^=]*=\(.*\)$/\1/" | sed -e "s/\+/ /g")"
5 vids="$DOCUMENT_ROOT/Info/Quartz/video/video_tapes.csv"
6
7 randof="$(mktemp "$TMP/zz_randocgi.XXXXXX")"
8
9 sh show_stripper.sh "$vids" "$show_name" &>"$randof"
10
11 if [ -s "$randof" ]; then
12
13   echo "Content-type: text/plain"
14   echo ""
15   echo ""
16   cat "$randof"
17
18 else
19
20   echo "Content-type: text/html"
21   echo ""
22   echo ""
23   cat /var/www/yeti/pictures/no_matches.html
24
25 fi
26
27 rm "$randof"
28