From 44614e75dc0e5bc84c168f82244d7a13e186fbea Mon Sep 17 00:00:00 2001 From: "guillaume.lambert" Date: Fri, 5 Mar 2021 18:29:20 +0100 Subject: [PATCH] Improve debug tools install Signed-off-by: guillaume.lambert Change-Id: I287fd6e692a70979599b93ff3b59b06706ee62c4 --- debug_tools/install_perl_dependencies.sh | 25 +++++++++++++++++++ debug_tools/netconf_TCP_SSH_hijackingproxy.pl | 4 +-- debug_tools/netconf_terminal.pl | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100755 debug_tools/install_perl_dependencies.sh diff --git a/debug_tools/install_perl_dependencies.sh b/debug_tools/install_perl_dependencies.sh new file mode 100755 index 000000000..d2ef82d51 --- /dev/null +++ b/debug_tools/install_perl_dependencies.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set +x + +#check if apt exists +if sudo apt-get install libnet-openssh-perl libio-pty-perl;then + echo "installed." + exit +fi +#check if yum exists +if sudo yum install perl-Net-OpenSSH perl-IO-Tty;then + echo "yum-get is installed." + sudo yum install perl-Net-OpenSSH perl-IO-Tty + exit +fi +#check if cpanm exists +if [ -x "$(command -v cpanm)" ];then + echo "cpanm is installed." + cpanm IO::Pty + cpanm Net::OpenSSH + exit +else + echo "cannot install dependencies: apt-get and yum and perlbrew/cpanm are not available." >&2 + exit 1 +fi diff --git a/debug_tools/netconf_TCP_SSH_hijackingproxy.pl b/debug_tools/netconf_TCP_SSH_hijackingproxy.pl index 05ba2de83..e1d35fc4d 100755 --- a/debug_tools/netconf_TCP_SSH_hijackingproxy.pl +++ b/debug_tools/netconf_TCP_SSH_hijackingproxy.pl @@ -7,7 +7,7 @@ # and is available at http://www.eclipse.org/legal/epl-v10.html ############################################################################## # -# debian dependecies: apt-get install libnet-openssh-perl libio-pty-perl +# debian dependencies: apt-get install libnet-openssh-perl libio-pty-perl # use strict; @@ -40,7 +40,7 @@ are then proxified between both ends. By default, exchanges are altered according to the rules specified inside this script and easily modifiable. This behaviour can be disabled with the '-s' option. For more convenience, the server hello handshake can also alternatively be replaced by the content -of an external file rather instead of writing specific rules. +of an external file instead of writing specific rules. OPTIONS : diff --git a/debug_tools/netconf_terminal.pl b/debug_tools/netconf_terminal.pl index c5d0e8037..789fe187e 100755 --- a/debug_tools/netconf_terminal.pl +++ b/debug_tools/netconf_terminal.pl @@ -7,7 +7,7 @@ # and is available at http://www.eclipse.org/legal/epl-v10.html ############################################################################## # -# debian dependecies: apt-get install libnet-openssh-perl libio-pty-perl +# debian dependencies: apt-get install libnet-openssh-perl libio-pty-perl # use strict; -- 2.36.6