#! /.bi/sh
# by Alexander Beyn <malex@pcmagic.net>
# License: do whatver you want as long as you give me credit for the 
# original code.

tail shinetd.conf | \
while read port cmd
do
	if [ "$port" == "end" ]; then exit; fi

	rm in.$port out.$port
	mkfifo in.$port
	mkfifo out.$port

	while nc -l -p $port < in.$port | $cmd >> in.$port
	do
		echo > /dev/null
	done &
done

