From d0bd96746a8a5342edf106a562a38369b883f9d1 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Sat, 8 Oct 2022 15:45:53 +0200 Subject: [PATCH] big debug Signed-off-by: Daniel Tartavel --- README.md | 10 ++++++++-- SOURCES/connect2member.sh | 4 ++-- SOURCES/sshconnect | 26 ++++++++++++++++++++++++-- SOURCES/sshconnect.cfg | 2 ++ SPECS/lalis-assistance.spec | 2 +- 5 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 SOURCES/sshconnect.cfg diff --git a/README.md b/README.md index 924fbf7..7eaea22 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ -# lalis-assistance +## lalis-assistance + +Outils d'assistance pour les collaborateurs Lalis. + +Commandes : +sshconnect - ouvre terminal sur la machine distante à travers le serveur Lalis. + Demande les paramètres de connexion manquants et les sauvegarde dans ~/.config/sshconnect.cfg +connect2member.sh - ouvre une session vnc sur la machine distante à travers le serveur Lalis. -Outils d'assistance pour les collaborateurs Lalis \ No newline at end of file diff --git a/SOURCES/connect2member.sh b/SOURCES/connect2member.sh index 6260a9e..fa5c998 100755 --- a/SOURCES/connect2member.sh +++ b/SOURCES/connect2member.sh @@ -1,7 +1,7 @@ #!/bin/sh ssh -N -f -L 5900:localhost:5900 -p 10022 lalis69.ddns.net -if ! [ -e ~/.config/remmina/group_vnc_lalis_localhost-5900.remmina ] - cp /usr/share/lalis/group_vnc_lalis_localhost-5900.remmina ~/.config/remmina/ +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 diff --git a/SOURCES/sshconnect b/SOURCES/sshconnect index 63e5be8..3ed4629 100755 --- a/SOURCES/sshconnect +++ b/SOURCES/sshconnect @@ -1,4 +1,26 @@ #!/usr/bin/sh -ssh -p 10022 -N -f -L 6000:localhost:6000 @ - +CONFIGPATH=~/.config/sshconnect.cfg +if ! [ -f $CONFIGPATH ]; 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 + . $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 +fi +echo "ssh -p $PORT -N -f -L 6000:localhost:6000 $SSHUSER@$SERVER" +ssh -p $PORT -N -f -L 6000:localhost:6000 $SSHUSER@$SERVER diff --git a/SOURCES/sshconnect.cfg b/SOURCES/sshconnect.cfg new file mode 100644 index 0000000..213acdc --- /dev/null +++ b/SOURCES/sshconnect.cfg @@ -0,0 +1,2 @@ +SERVER=lalis69.ddns.net +PORT=10022 diff --git a/SPECS/lalis-assistance.spec b/SPECS/lalis-assistance.spec index e10b030..508829e 100644 --- a/SPECS/lalis-assistance.spec +++ b/SPECS/lalis-assistance.spec @@ -1,7 +1,7 @@ Summary: Install LALIS Assistance Name: lalis-assistance Version: 1 -Release: %mkrel 5 +Release: %mkrel 7 License: GPLv3 Group: Tools Url: http://lalis.fr