1
0

added config load to connect2member

Signed-off-by: Daniel Tartavel <dtux@free.fr>
This commit is contained in:
Daniel Tartavel 2022-10-08 16:28:31 +02:00
parent d0bd96746a
commit 7d6ac0c81c
4 changed files with 61 additions and 27 deletions

33
SOURCES/connect2member Normal file
View File

@ -0,0 +1,33 @@
#!/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

View File

@ -1,7 +0,0 @@
#!/bin/sh
ssh -N -f -L 5900:localhost:5900 -p 10022 lalis69.ddns.net
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

View File

@ -1,26 +1,30 @@
#!/usr/bin/sh
SYSCONFIGPATH=/etc/sshconnect.cfg
CONFIGPATH=~/.config/sshconnect.cfg
if ! [ -f $CONFIGPATH ]; then
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
. $CONFIGPATH
if [ -z "$SSHUSER" ]; then
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
fi
if [ -z "$SERVER" ]; then
read -p "Serveur : " SERVER
echo -e "SERVER=$SERVER\n" >>$CONFIGPATH
fi
if [ -z "$PORT" ]; then
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

View File

@ -1,17 +1,18 @@
Summary: Install LALIS Assistance
Name: lalis-assistance
Version: 1
Release: %mkrel 7
Version: 1.3
Release: %mkrel 2
License: GPLv3
Group: Tools
Url: http://lalis.fr
BuildArch: noarch
Source1: connect2member.sh
Source1: connect2member
Source2: sshconnect
Source3: Assistance_Lalis_vnc.desktop
Source4: Assistance_Lalis_ssh.desktop
Source5: group_vnc_lalis_localhost-5900.remmina
Source6: sshconnect.cfg
Requires: tigervnc
Requires: openssh-clients
@ -23,6 +24,7 @@ This package installs LALIS assistance programs.
%install
mkdir -p %{buildroot}%{_sysconfdir}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/lalis
mkdir %{buildroot}%{_datadir}/kio_desktop
@ -34,6 +36,7 @@ cp %{SOURCE3} %{buildroot}%{_datadir}/dist/desktop-files/default/
cp %{SOURCE4} %{buildroot}%{_datadir}/kio_desktop/
cp %{SOURCE4} %{buildroot}%{_datadir}/dist/desktop-files/default/
cp %{SOURCE5} %{buildroot}%{_datadir}/lalis/group_vnc_lalis_localhost-5900.remmina
cp %{SOURCE6} %{buildroot}%{_sysconfdir}/sshconnect.cfg
%files
%{_bindir}/connect2member.sh
@ -41,3 +44,4 @@ cp %{SOURCE5} %{buildroot}%{_datadir}/lalis/group_vnc_lalis_localhost-5900.remmi
%{_datadir}/kio_desktop/*
%{_datadir}/dist/desktop-files/default/*
%{_datadir}/lalis/group_vnc_lalis_localhost-5900.remmina
%{_sysconfdir}/sshconnect.cfg