diff --git a/csharp/App/SaliMax/run (Salimax 0001).sh b/csharp/App/SaliMax/run (Salimax 0001).sh index 2091f5208..c54c82e6f 100755 --- a/csharp/App/SaliMax/run (Salimax 0001).sh +++ b/csharp/App/SaliMax/run (Salimax 0001).sh @@ -1,33 +1,34 @@ #!/bin/bash dotnet_version='net6.0' -salimax_ip= '10.2.3.104' +salimax_ip='10.2.3.104' username='ie-entwicklung' set -e echo -e "\n============================ Build ============================\n" -dotnet publish \ +dotnet publish \ ./SaliMax.csproj \ + -p:PublishTrimmed=false \ -c Release \ - -r linux-x64 - + -r linux-x64 + echo -e "\n============================ Deploy ============================\n" rsync -v \ ./bin/Release/$dotnet_version/linux-x64/publish/* \ - ie-entwicklung@10.2.3.104:~/salimax + $username@$salimax_ip:~/salimax echo -e "\n============================ Restart Salimax sevice ============================\n" ssh -tt \ - ie-entwicklung@10.2.3.104 \ + $username@$salimax_ip \ sudo systemctl restart salimax.service echo -e "\n============================ Print service output ============================\n" ssh -tt \ - ie-entwicklung@10.2.3.104 \ + $username@$salimax_ip \ journalctl -f -u salimax.service diff --git a/csharp/App/SaliMax/run (Salimax0002).sh b/csharp/App/SaliMax/run (Salimax0002).sh new file mode 100644 index 000000000..44b8fe549 --- /dev/null +++ b/csharp/App/SaliMax/run (Salimax0002).sh @@ -0,0 +1,34 @@ +#!/bin/bash + +dotnet_version='net6.0' +salimax_ip='10.2.4.29' +username='ie-entwicklung' + +set -e + +echo -e "\n============================ Build ============================\n" + +dotnet publish \ + ./SaliMax.csproj \ + -p:PublishTrimmed=false \ + -c Release \ + -r linux-x64 + +echo -e "\n============================ Deploy ============================\n" + +rsync -v \ + ./bin/Release/$dotnet_version/linux-x64/publish/* \ + $username@$salimax_ip:~/salimax + +echo -e "\n============================ Restart Salimax sevice ============================\n" + +ssh -tt \ + $username@$salimax_ip \ + sudo systemctl restart salimax.service + + +echo -e "\n============================ Print service output ============================\n" + +ssh -tt \ + $username@$salimax_ip \ + journalctl -f -u salimax.service \ No newline at end of file diff --git a/csharp/App/SaliMax/tunnelstoSalimax0002.sh b/csharp/App/SaliMax/tunnelstoSalimax0002.sh new file mode 100755 index 000000000..98cd400bd --- /dev/null +++ b/csharp/App/SaliMax/tunnelstoSalimax0002.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +host=ie-entwicklung@10.2.4.29 + +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 9001 +tunnel "Trumpf DCDC (http) " 10.0.3.1 80 9002 +tunnel "Ext Emu Meter (http) " 10.0.4.1 80 9003 +tunnel "Int Emu Meter (http) " 10.0.4.2 80 9004 +tunnel "AMPT (http) " 10.0.5.1 8080 9005 + +#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 3007 + + +echo +echo "press any key to close the tunnels ..." +read -r -n 1 -s +kill $(jobs -p) +echo "done" diff --git a/csharp/App/SaliMax/tunnelstoSalimax0003.sh b/csharp/App/SaliMax/tunnelstoSalimax0003.sh index da40a584a..a5e184247 100755 --- a/csharp/App/SaliMax/tunnelstoSalimax0003.sh +++ b/csharp/App/SaliMax/tunnelstoSalimax0003.sh @@ -33,7 +33,7 @@ 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 +tunnel "Batteries " 127.0.0.1 6855 3007 echo