root/10kz/shell/test-post.jm3

Revision 43, 0.7 kB (checked in by jm3, 2 years ago)
  • set Id property on all text-based files
  • correctly handling the "no keys found" case with link to GPG help page (just a stub at this point)
  • Property svn:executable set to *
  • Property svn:keywords set to Id
Line 
1 #!/bin/bash
2
3 echo Content-type: text/html
4 echo
5 if [ -z "$CONTENT_LENGTH" ]
6 then
7         echo "<h1>Your browser did not send a 'POST' HTTP request; bailing.</h1> "
8         exit 1
9 fi
10
11 echo "<pre>"
12 echo \$CONTENT_LENGTH is $CONTENT_LENGTH
13 echo \$REQUEST_METHOD is $REQUEST_METHOD
14 echo "</pre>"
15 echo
16
17 data=`cat | sed "s/+/ /g"`
18 #data=`cat`
19
20 s=$data
21
22 for donk in $s
23 do
24
25 params=`echo $donk | sed "s/&/ /g"`
26 for p in $params
27 do
28         echo $p
29         tokens=`echo $p | sed "s/\+/__SPACE__/g" | sed "s/%\([0-9A-F][0-9A-F]\)/ HEX:\1 /g"`
30
31         for t in $tokens
32         do
33                 echo $t | grep -q HEX:
34                 if [ $? = 0 ]
35                 then
36                         t=`echo $t | sed s/HEX://`
37                         echo `printf "%d" 0x$t` | awk '{printf("%c", $1)}'
38                 else
39                         echo -n `echo $t | sed "s/__SPACE__/ /g"`
40                 fi
41                 done
42                 echo
43                 echo
44
45 done
46 done
47         exit 1
48
49 exit 0
50
Note: See TracBrowser for help on using the browser.