You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
1.1 KiB

#!/bin/bash
xterm -geometry +0+0 -e './node 127.0.0.1 2002 2001 1 3001' &
xterm -geometry +500+0 -e './node 127.0.0.1 2003 2002 2 3002' &
xterm -geometry +1000+0 -e './node 127.0.0.1 2001 2003 3 3003' &
sleep 1s
(echo "subscribe 2 4012" | netcat 127.0.0.1 3001 ; echo 1 → 2) &
(echo "subscribe 3 4013" | netcat 127.0.0.1 3001 ; echo 1 → 3) &
(echo "subscribe 1 4021" | netcat 127.0.0.1 3002 ; echo 2 → 1) &
(echo "subscribe 3 4023" | netcat 127.0.0.1 3002 ; echo 2 → 3) &
(echo "subscribe 1 4031" | netcat 127.0.0.1 3003 ; echo 3 → 1) &
(echo "subscribe 2 4032" | netcat 127.0.0.1 3003 ; echo 3 → 2) &
wait %4 %5 %6 %7 %8 %9
xterm -T '1 → 2' -geometry +0+378 -e 'netcat 127.0.0.1 4012' &
xterm -T '1 → 3' -geometry +0+750 -e 'netcat 127.0.0.1 4013' &
xterm -T '2 → 1' -geometry +500+378 -e 'netcat 127.0.0.1 4021' &
xterm -T '2 → 3' -geometry +500+750 -e 'netcat 127.0.0.1 4023' &
xterm -T '3 → 1' -geometry +1000+378 -e 'netcat 127.0.0.1 4031' &
xterm -T '3 → 2' -geometry +1000+750 -e 'netcat 127.0.0.1 4032' &
wait %4 %5 %6 %7 %8 %9