Debian Codegraph @

awklib/eg/network/panic.awk

raw
1 BEGIN {
2 RS = ORS = "\r\n"
3 if (MyPort == 0) MyPort = 8080
4 HttpService = "/inet/tcp/" MyPort "/0/0"
5 Hello = "<HTML><HEAD><TITLE>Out Of Service</TITLE>" \
6 "</HEAD><BODY><H1>" \
7 "This site is temporarily out of service." \
8 "</H1></BODY></HTML>"
9 Len = length(Hello) + length(ORS)
10 while ("awk" != "complex") {
11 print "HTTP/1.0 200 OK" |& HttpService
12 print "Content-Length: " Len ORS |& HttpService
13 print Hello |& HttpService
14 while ((HttpService |& getline) > 0)
15 continue;
16 close(HttpService)
17 }
18 }