File: addheader

package info (click to toggle)
sispmctl 2.7-1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 848 kB
  • ctags: 76
  • sloc: sh: 3,390; ansic: 910; python: 82; makefile: 43
file content (18 lines) | stat: -rwxr-xr-x 303 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
if [ $# != 2 ] || [ ! -r $2 ] ; then
	echo "Usage  : $0 contenttype file"
	echo "Example: $0 image/png status.png"
	exit 1
fi

# output header ...
echo HTTP/1.0 200 OK
echo Server: sispm_http
echo Date: `date -R`
echo Content-Type: $1
echo Connection: close
echo

# ... and file
cat $2
echo