mirror of
https://git.phreedom.club/localhost_frssoft/bbs-telnet
synced 2024-11-23 19:19:21 +02:00
random port selection
This commit is contained in:
parent
fad4fbc7f9
commit
bcf33de7e1
|
@ -11,4 +11,4 @@ $EDITOR config
|
||||||
```run server (socat required)
|
```run server (socat required)
|
||||||
./bss.sh <PORT>
|
./bss.sh <PORT>
|
||||||
```
|
```
|
||||||
|
run it without argument -> random port selected
|
||||||
|
|
10
bbs.sh
10
bbs.sh
|
@ -1,7 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "listening for commands on 0.0.0.0:$1"
|
if [ ! -n "$1" ]; then
|
||||||
|
port=$(shuf -i 1024-65000 -n 1)
|
||||||
|
else
|
||||||
|
port=$1
|
||||||
|
fi
|
||||||
|
|
||||||
socat -v -v TCP-LISTEN:$1,reuseaddr,pktinfo,fork SYSTEM:"./executor.sh"
|
echo "listening for commands on 0.0.0.0:$port"
|
||||||
|
|
||||||
|
socat -v -v TCP-LISTEN:$port,reuseaddr,pktinfo,fork SYSTEM:"./executor.sh"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue