diff --git a/csharp/App/SaliMax/tunnelstoSalimax0001.sh b/csharp/App/SaliMax/tunnelstoSalimax0001.sh index f538423bb..8b5fb2697 100755 --- a/csharp/App/SaliMax/tunnelstoSalimax0001.sh +++ b/csharp/App/SaliMax/tunnelstoSalimax0001.sh @@ -35,6 +35,8 @@ tunnel "Ext Emu Meter (modbus) " 10.0.4.1 502 4003 tunnel "Int Emu Meter " 10.0.4.2 502 4004 tunnel "AMPT (modbus) " 10.0.5.1 502 4005 tunnel "Adam " 10.0.1.1 502 4006 +tunnel "Batteries " 127.0.0.1 6855 5007 + diff --git a/csharp/App/SaliMax/tunnelstoSalimax0003.sh b/csharp/App/SaliMax/tunnelstoSalimax0003.sh new file mode 100755 index 000000000..da40a584a --- /dev/null +++ b/csharp/App/SaliMax/tunnelstoSalimax0003.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +host=ie-entwicklung@10.2.4.33 + +tunnel() { + name=$1 + ip=$2 + rPort=$3 + lPort=$4 + + echo -n "localhost:$lPort $name " + 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 "" + +tunnel "Trumpf Inverter (http) " 10.0.2.1 80 6001 +tunnel "Trumpf DCDC (http) " 10.0.3.1 80 6002 +tunnel "Ext Emu Meter (http) " 10.0.4.1 80 6003 +tunnel "Int Emu Meter (http) " 10.0.4.2 80 6004 +tunnel "AMPT (http) " 10.0.5.1 8080 6005 + +tunnel "Trumpf Inverter (modbus)" 10.0.2.1 502 3001 +tunnel "Trumpf DCDC (modbus) " 10.0.3.1 502 3002 +tunnel "Ext Emu Meter (modbus) " 10.0.4.1 502 3003 +tunnel "Int Emu Meter " 10.0.4.2 502 3004 +tunnel "AMPT (modbus) " 10.0.5.1 502 3005 +tunnel "Batteries " 127.0.0.1 6855 5007 + + +echo +echo "press any key to close the tunnels ..." +read -r -n 1 -s +kill $(jobs -p) +echo "done"