Delete old scripts and create a common one

This commit is contained in:
atef 2023-07-24 10:54:50 +02:00
parent a677c878e8
commit 6270a0d8a3
10 changed files with 14 additions and 273 deletions

6
csharp/App/SaliMax/HostList.sh Executable file
View File

@ -0,0 +1,6 @@
Prototype ie-entwicklung@10.2.3.115
Salimax001 ie-entwicklung@10.2.3.104
Salimax002 ie-entwicklung@10.2.4.29
Salimax003 ie-entwicklung@10.2.4.33
Salimax004 ie-entwicklung@10.2.4.32

View File

@ -1,7 +1,7 @@
#!/bin/bash
dotnet_version='net6.0'
salimax_ip='10.2.4.29'
salimax_ip="$1"
username='ie-entwicklung'
set -e
@ -20,15 +20,3 @@ 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

View File

@ -1,34 +0,0 @@
#!/bin/bash
dotnet_version='net6.0'
salimax_ip='10.2.3.104'
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

View File

@ -1,34 +0,0 @@
#!/bin/bash
dotnet_version='net6.0'
salimax_ip='10.2.4.33'
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

View File

@ -1,34 +0,0 @@
#!/bin/bash
dotnet_version='net6.0'
salimax_ip='10.2.3.115'
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

View File

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tunnels</title>
</head>
<body>
<div style="font-family: sans-serif; margin: 20px">
<a target="_blank" href="http://localhost:8001">Inverter</a><br>
<a target="_blank" href="http://localhost:8002">DCDC</a><br>
<a target="_blank" href="http://localhost:8003">Emu Meter</a><br>
<a target="_blank" href="http://localhost:8004">ADAM</a><br>
<a target="_blank" href="http://localhost:8005">AMPT</a><br>
</div>
</body>
</html>

View File

@ -1,44 +0,0 @@
#!/bin/bash
host=ie-entwicklung@10.2.3.115
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 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
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"

View File

@ -1,43 +0,0 @@
#!/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"

View File

@ -1,43 +0,0 @@
#!/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 3007
echo
echo "press any key to close the tunnels ..."
read -r -n 1 -s
kill $(jobs -p)
echo "done"

View File

@ -1,6 +1,6 @@
#!/bin/bash
host=ie-entwicklung@10.2.3.104
host="ie-entwicklung@$1"
tunnel() {
name=$1
@ -27,19 +27,16 @@ tunnel "Trumpf DCDC (http) " 10.0.3.1 80 7002
tunnel "Ext Emu Meter (http) " 10.0.4.1 80 7003
tunnel "Int Emu Meter (http) " 10.0.4.2 80 7004
tunnel "AMPT (http) " 10.0.5.1 8080 7005
tunnel "Doepke (http) " 10.0.6.1 80 7006
tunnel "Trumpf Inverter (modbus)" 10.0.2.1 502 4001
tunnel "Trumpf DCDC (modbus) " 10.0.3.1 502 4002
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 "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 "Batteries " 127.0.0.1 6855 5007
echo
echo "press any key to close the tunnels ..."
read -r -n 1 -s