34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
|
#!/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
|