make a nex server on a
BSD computer. fill a
file with this code:
#!/bin/sh
BASE="/home/user/public/nexsite"
read -r req || exit 0
req=$(printf "%s" "$req" | tr -d '\r')
req=$(printf "%s" "$req" | tr -cd 'a-zA-Z0-9_')
[ -z "$req" ] && req="index"
file="$BASE/$req"
if [ -f "$file" ]; then
printf "nexsocial\r\n"
cat "$file"
else
printf "51 Not found\r\n"
fi
exit 0
___________________________________
make it executable
and start it with:
ncat -l 1900 --keep-open --exec /home/user/sam0.sh