1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__lalis-assistance/SOURCES/connect2member
Daniel Tartavel 7d6ac0c81c added config load to connect2member
Signed-off-by: Daniel Tartavel <dtux@free.fr>
2022-10-08 16:28:31 +02:00

34 lines
1.1 KiB
Bash

#!/bin/sh
SYSCONFIGPATH=/etc/sshconnect.cfg
CONFIGPATH=~/.config/sshconnect.cfg
if ! [ -e $CONFIGPATH ]; then
if ! [ -e $SYSCONFIGPATH ]; then
echo "Saississez les données de connexion au serveur"
read -p "Nom d'utilisateur : " SSHUSER
read -p "Serveur : " SERVER
read -p "Port ssh : " PORT
echo -e "SSHUSER=$SSHUSER\nSERVER=$SERVER\nPORT=$PORT" >$CONFIGPATH
else
cp $SYSCONFIGPATH $CONFIGPATH
fi
fi
. $CONFIGPATH
if [ -z "$SSHUSER" ]; then
read -p "Nom d'utilisateur : " SSHUSER
echo -e "SSHUSER=$SSHUSER\n" >>$CONFIGPATH
fi
if [ -z "$SERVER" ]; then
read -p "Serveur : " SERVER
echo -e "SERVER=$SERVER\n" >>$CONFIGPATH
fi
if [ -z "$PORT" ]; then
read -p "Nom d'utilisateur : " PORT
echo -e "PORT=$PORT\n" >>$CONFIGPATH
fi
ssh -N -f -L 5900:localhost:5900 -p $PORT $SERVER
if ! [ -e ~/.config/remmina/group_vnc_lalis_localhost-5900.remmina ];then
cp /usr/share/lalis/group_vnc_lalis_localhost-5900.remmina ~/.local/share/remmina/lalis_vnc_lalis_lalis69-ddns-net.remmina
fi
remmina -c ~/.config/remmina/group_vnc_lalis_localhost-5900.remmina