File: test-2.x

package info (click to toggle)
redir 3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 200 kB
  • sloc: ansic: 773; makefile: 25; sh: 25
file content (23 lines) | stat: -rwxr-xr-x 334 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

exec 2>&1
set -ex

echo "test redir" > input

nc -q 0 -l -p 9000 < input &
pid_nc=$!
sleep 1

redir --laddr=127.0.0.1 --lport=5000  --caddr=127.0.0.1 --cport=9000 &
pid_redir=$!
sleep 1

nc 127.0.0.1 5000 > output

function clean_up {
  kill -9 $pid_redir
}
trap clean_up EXIT SIGHUP SIGINT SIGTERM

diff -u input output