Add "serve.sh", a script to serve another script's output via netcat

This commit is contained in:
marc René Schädler 2013-11-13 11:59:51 +01:00 committed by Tim Niemeyer
parent ec61999da2
commit 3f2a6e9f94
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#!/bin/ash
[ $# -ge 3 ] || exit 1
PORT="$1"
DELAY="$2"
shift 2
COMMAND="$@"
while true; do
(nc -l -p $PORT -e $COMMAND) > /dev/null 2>&1
sleep $DELAY
done