diff options
author | bptato <nincsnevem662@gmail.com> | 2023-12-10 11:47:11 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-12-10 15:08:53 +0100 |
commit | 2dec7483045c9e5696182db7b4ad842491b6c2b2 (patch) | |
tree | eb4173f62684a6334a75254c88a3b0d840284ea7 /bonus | |
parent | e5a0fd6af4296f76987530a9566eb019307fa8bf (diff) | |
download | chawan-2dec7483045c9e5696182db7b4ad842491b6c2b2.tar.gz |
Enable finger protocol by default
* Add a default urimethodmap that points finger: to cha-finger * Install cha-finger to /usr/local/libexec/cha/cgi-bin by default * cha-finger: use ALL_PROXY if given, die if curl is not installed
Diffstat (limited to 'bonus')
-rwxr-xr-x | bonus/finger/cha-finger | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/bonus/finger/cha-finger b/bonus/finger/cha-finger deleted file mode 100755 index a0f68ef5..00000000 --- a/bonus/finger/cha-finger +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# Finger protocol adapter for Chawan. Requires curl. -# (It also works with w3m.) -# -# Usage: put this script in your cgi-bin folder, then add the following line to -# your urimethodmap: -# -# finger: file:/cgi-bin/cha-finger?%s - -printf 'Content-Type: text/plain\r\n\r\n' -if test -z "$QUERY_STRING" -then echo "URL expected" - exit 1 -fi -URL="$(printf '%s\n' "$QUERY_STRING" | \ - sed 's/^finger:\/\///;s/^\([^[]\/:]\|\[[^]:]*\]\):79/\1/')" - -if printf '%s\n' "$URL" | grep -q '^\([^[]/]*\)\|\(\[[^]]*\]\):[0-9]' -then echo "Invalid port" - exit 1 -fi - -case "$URL" in -*@*) USER="$(printf '%s\n' "$URL" | sed 's/@.*//')" - HOST="$(printf '%s\n' "$URL" | \ - tail -c +$((${#USER} + 2)) | \ - sed 's/\/.*//')" - ;; -*/w*) HOST="$(printf '%s\n' "$URL" | sed 's/\/.*//')" - USER="/w $(printf '%s\n' "$URL" | tail -c +$((${#HOST} + 4)))" - ;; -*) HOST="$(printf '%s\n' "$URL" | sed 's/\/.*//')" - USER="$(printf '%s\n' "$URL" | tail -c +$((${#HOST} + 2)))" - ;; -esac - -printf '%s\r\n' "$USER" | curl -- "telnet://$HOST:79" 2>/dev/null |