3 ms·
rmate is pretty cool. I'm using this script locally to forward connections from a server with rmate installed. Save this to /bin/matehost and adapt the list of
by quonn 15y ago
rmate is pretty cool. I'm using this script locally to forward connections from a server with rmate installed. Save this to /bin/matehost and adapt the list of hosts to
#!/bin/sh
###########################################
mhosts=(
host1
host2
)
###########################################
mpids=()
for i in "${mhosts[@]}"
do
ssh -nNT -R 52698:localhost:52698 ${i} &
mpids[$[${#mpids[@]}+1]]=$!
done
read -p "Press any key to close tunnels ..." -n 1
for i in "${mpids[@]}"
do
if [[ `ps $PIDns` == ssh ]]
then
kill ${i}
fi
done