Innovenergy_trunk/csharp/App/SaliMax/tunnelstoSalimaxX.sh

45 lines
1.0 KiB
Bash
Raw Normal View History

2023-07-03 12:23:58 +00:00
#!/bin/bash
2023-06-13 11:01:48 +00:00
host="ie-entwicklung@$1"
2023-06-13 11:01:48 +00:00
tunnel() {
name=$1
ip=$2
rPort=$3
lPort=$4
2023-08-18 13:57:00 +00:00
echo -n "$name @ $ip mapped to localhost:$lPort "
2023-06-13 11:01:48 +00:00
ssh -nNTL "$lPort:$ip:$rPort" "$host" 2> /dev/null &
until nc -vz 127.0.0.1 $lPort 2> /dev/null
do
echo -n .
sleep 0.3
done
echo "ok"
}
echo ""
2023-08-18 13:57:00 +00:00
tunnel "Trumpf Inverter (http) " 10.0.2.1 80 8001
tunnel "Trumpf DCDC (http) " 10.0.3.1 80 8002
tunnel "Ext Emu Meter (http) " 10.0.4.1 80 8003
tunnel "Int Emu Meter (http) " 10.0.4.2 80 8004
tunnel "AMPT (http) " 10.0.5.1 8080 8005
tunnel "Trumpf Inverter (modbus)" 10.0.2.1 502 5001
tunnel "Trumpf DCDC (modbus) " 10.0.3.1 502 5002
tunnel "Ext Emu Meter (modbus) " 10.0.4.1 502 5003
tunnel "Int Emu Meter " 10.0.4.2 502 5004
tunnel "AMPT (modbus) " 10.0.5.1 502 5005
tunnel "Adam " 10.0.1.1 502 5006 #for AMAX is 10.0.1.3
2024-05-07 12:39:11 +00:00
tunnel "Batteries " 127.0.0.1 6855 5007
2023-06-13 11:01:48 +00:00
echo
echo "press any key to close the tunnels ..."
read -r -n 1 -s
kill $(jobs -p)
echo "done"
2023-08-18 13:57:00 +00:00