#!/bin/bash # Copyright (c) 2024-2025 Rodrigo Arias Mallo # SPDX-License-Identifier: GPL-3.0-or-later IFS= read -d '>' auth # Ignore auth IFS= read -d '>' cmd case "$cmd" in "\n" printf "Content-type: text/plain\r\n\r\n" echo "Not found" exit 0 } serve_manpage() { url="$1" ref="${url#"info:"}" # If page not found, return 404 #if [ -z "$ref" ]; then # serve_404 # exit 0 #fi printf "\n" printf "Content-type: text/html\r\n\r\n" perl ~/.dillo/dpi/info/info2html "$ref" } case "$url" in info:*) serve_manpage "$url";; *) serve_404;; esac