Ecrit le script pour créer en batch les tunnels SSH pour tous les NodeMCU en remotes via la passerelle SSH reverse
This commit is contained in:
@@ -172,6 +172,10 @@ cat("boot2.lua")
|
||||
./luatool.py --ip $zIP:$zport --delete toto.lua
|
||||
|
||||
|
||||
|
||||
****************************************************************************
|
||||
|
||||
|
||||
# création des tunnels ssh
|
||||
ATTENTION: dans un premier terminal !
|
||||
Pour Bolo à Ruchonnet:
|
||||
|
||||
42
Mesures/humidity/bolo/make_tunnels.sh
Executable file
42
Mesures/humidity/bolo/make_tunnels.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# Petit script pour créer tous les tunnels SSH sur les NodeMCU en remote
|
||||
# zf191225.1352
|
||||
|
||||
# Définition des variables
|
||||
TREMPLIN_SSH=www.zuzutest.ml
|
||||
OPIZ_PORT=20223
|
||||
|
||||
TH1_IP=192.168.8.100
|
||||
TH1_PORT=23001
|
||||
TH2_IP=192.168.8.101
|
||||
TH2_PORT=23002
|
||||
TH3_IP=192.168.8.102
|
||||
TH3_PORT=23003
|
||||
TH4_IP=192.168.8.103
|
||||
TH4_PORT=23004
|
||||
|
||||
|
||||
# On tue tous les tunnels ssh
|
||||
echo "kill"
|
||||
killall -9 ssh
|
||||
sleep 3
|
||||
|
||||
# On crée le tunnel sur la passerelle ssh 20223
|
||||
echo "first"
|
||||
ssh -y -y -N -T -L $OPIZ_PORT:localhost:$OPIZ_PORT ubuntu@$TREMPLIN_SSH &
|
||||
sleep 3
|
||||
|
||||
# On crée tous les tunnels sur les nodemcu
|
||||
echo "second"
|
||||
ssh -y -y -N -T -L $TH1_PORT:$TH1_IP:23 ubuntu@localhost -p $OPIZ_PORT &
|
||||
ssh -y -y -N -T -L $TH2_PORT:$TH2_IP:23 ubuntu@localhost -p $OPIZ_PORT &
|
||||
ssh -y -y -N -T -L $TH3_PORT:$TH3_IP:23 ubuntu@localhost -p $OPIZ_PORT &
|
||||
ssh -y -y -N -T -L $TH4_PORT:$TH4_IP:23 ubuntu@localhost -p $OPIZ_PORT &
|
||||
sleep 3
|
||||
|
||||
echo "end"
|
||||
ps ax |grep ssh
|
||||
|
||||
# On liste les fichiers de chaque nodemcu
|
||||
#echo -e "th1"
|
||||
#/luatool.py --ip localhost:$TH1_PORT --list
|
||||
Reference in New Issue
Block a user