geomyidae

A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log | Files | Refs | README | LICENSE

xinetd-gopher-request-filter.sh (381B)


      1 #!/bin/sh
      2 #
      3 # Copy me if you can.
      4 #
      5 # Change to fit to your original running geomyidae instance.
      6 dstserver="localhost"
      7 dstport="7070"
      8 
      9 read -r request
     10 request="$(printf "%s\n" "${request}" | tr -d '\r')"
     11 case "${request}" in
     12 *bill-gates*|*cia*)
     13 	printf "3The request cannot be handled\terror\t70\r\n"
     14 	;;
     15 *)
     16 	printf "%s\r\n" "${request}" | nc "${dstserver}" "${dstport}"
     17 	;;
     18 esac
     19