Add "serve.sh", a script to serve another script's output via netcat
This commit is contained in:
parent
ec61999da2
commit
3f2a6e9f94
1 changed files with 13 additions and 0 deletions
13
bsp/default/root_file_system/etc/serve.sh
Executable file
13
bsp/default/root_file_system/etc/serve.sh
Executable 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
|
Loading…
Add table
Reference in a new issue