commit 45abd3c4e74cb6ed7f1189d19eff8713e32b79d6
parent 4421e58e64811bdf2e879e76a0c255148df69e7b
Author: noodle <noodle@pastanoggin.com>
Date: Fri, 27 Mar 2026 12:23:36 +0000
remove awk.cgi as i forgot to
Diffstat:
| D | awk.cgi | | | 65 | ----------------------------------------------------------------- |
1 file changed, 0 insertions(+), 65 deletions(-)
diff --git a/awk.cgi b/awk.cgi
@@ -1,65 +0,0 @@
-#!/bin/awk -f
-
-function header(code){
- printf "Status: %s\nContent-Type: text/html\n\n", code
-}
-
-function readfile(a, i, path){
- while((ret = getline <path) > 0)
- a[i++] = $0
- if(ret == -1)
- print "couldn't read from "path >"/dev/stderr"
- return i
-}
-
-function cat(a, n, i){
- for(i = 0; i < n; i++)
- print a[i]
-}
-
-function error(code, a, len){
- header(code)
- len = readfile(a, 0, basedir"/docs/"code".html")
- cat(a, len)
-}
-
-function render(docpath, doctitle){
- template_path = basedir"/docs/main.tmp"
-
- while((ret = getline <template_path) > 0){
- if($0 ~ /\[%title%\]/)
- lines[len++] = doctitle
- else if($0 ~ /\[%content%\]/)
- len = readfile(lines, len, basedir"/docs/"docpath)
- else if($0 ~ /\[%status%\]/)
- len = readfile(lines, len, basedir"/docs/status.html")
- else
- lines[len++] = $0
- }
- if(ret == -1)
- print "couldn't read from "template_path >"/dev/stderr"
- if(len > 0){
- header(200)
- cat(lines, len)
- } else
- error(404)
-}
-
-BEGIN{
- basedir = "/htdocs/pastanoggin.com"
- $0 = ENVIRON["PATH_INFO"] ? ENVIRON["PATH_INFO"] : "/"
-
- if(/^\/?$/)
- render("root.html", "pastanoggin!!");
- else if(/^\/me\/?$/)
- render("me.html", "who?");
- else if(/^\/contact\/?$/)
- render("contact.html", "hello, is it me you're looking for?");
- else if(/^\/blog\/?$/)
- render("blog.html", "yapyapyapyap :D");
- else if(/^\/links\/?$/)
- render("links.html", "the interwebs");
- else
- error(404)
- exit
-}