From e878c37d0df3e8149aa440b866225b50cb4f48b9 Mon Sep 17 00:00:00 2001 From: Vincent de Saboulin Date: Fri, 24 May 2024 17:52:29 +0200 Subject: [PATCH] tcpdump install --- scripts/cli/playground | 8 ++++---- scripts/cli/src/commands/debug/tcp-dump.sh | 6 +++--- scripts/cli/src/lib/utils_function.sh | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/cli/playground b/scripts/cli/playground index 2631975b2..cadf05464 100755 --- a/scripts/cli/playground +++ b/scripts/cli/playground @@ -7535,7 +7535,7 @@ function maybe_create_image() then CONNECT_3RDPARTY_INSTALL="if [ ! -f /tmp/done ]; then yum -y install --disablerepo='Confluent*' bind-utils openssl unzip findutils net-tools nc jq which iptables libmnl krb5-workstation krb5-libs vim && yum clean all && rm -rf /var/cache/yum && rpm -i --nosignature https://rpmfind.net/linux/centos/8-stream/AppStream/aarch64/os/Packages/tcpdump-4.9.3-2.el8.aarch64.rpm && touch /tmp/done; fi" else - CONNECT_3RDPARTY_INSTALL="if [ ! -f /tmp/done ]; then curl http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/tcpdump-4.9.3-1.el8.x86_64.rpm -o tcpdump-4.9.3-1.el8.x86_64.rpm && rpm -Uvh tcpdump-4.9.3-1.el8.x86_64.rpm && yum -y install --disablerepo='Confluent*' bind-utils openssl unzip findutils net-tools nc jq which iptables libmnl krb5-workstation krb5-libs vim && yum clean all && rm -rf /var/cache/yum && touch /tmp/done; fi" + CONNECT_3RDPARTY_INSTALL="if [ ! -f /tmp/done ]; then && yum -y install --disablerepo='Confluent*' tcpdump bind-utils openssl unzip findutils net-tools nc jq which iptables libmnl krb5-workstation krb5-libs vim && yum clean all && rm -rf /var/cache/yum && touch /tmp/done; fi" fi else export CONNECT_USER="root" @@ -17437,12 +17437,12 @@ playground_debug_tcp_dump_command() { filename="tcp-dump-$container-$port-`date '+%Y-%m-%d-%H-%M-%S'`.pcap" set +e - docker exec $container which tcpdump > /dev/null 2>&1 + docker exec $container whereis tcpdump > /dev/null 2>&1 if [ $? != 0 ] then logwarn "tcpdump is not installed on container $container, attempting to install it" docker exec --privileged --user root $container bash -c "rpm -i --nosignature https://rpmfind.net/linux/centos/8-stream/AppStream/aarch64/os/Packages/tcpdump-4.9.3-2.el8.aarch64.rpm" > /dev/null 2>&1 - docker exec --privileged --user root $container bash -c "curl http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/tcpdump-4.9.3-1.el8.x86_64.rpm -o tcpdump-4.9.3-1.el8.x86_64.rpm && rpm -Uvh tcpdump-4.9.3-1.el8.x86_64.rpm" > /dev/null 2>&1 + docker exec --privileged --user root $container bash -c "yum update -y && yum install tcpdump -y" > /dev/null 2>&1 if [ "$container" == "ngrok" ] then @@ -17450,7 +17450,7 @@ playground_debug_tcp_dump_command() { fi docker exec --privileged --user root $container bash -c "apt-get update && echo tcpdump | xargs -n 1 apt-get install --force-yes -y && rm -rf /var/lib/apt/lists/*" > /dev/null 2>&1 fi - docker exec $container which tcpdump > /dev/null 2>&1 + docker exec $container whereis tcpdump > /dev/null 2>&1 if [ $? != 0 ] then logerror "❌ tcpdump could not be installed" diff --git a/scripts/cli/src/commands/debug/tcp-dump.sh b/scripts/cli/src/commands/debug/tcp-dump.sh index 0f5db0d41..1915b82b8 100644 --- a/scripts/cli/src/commands/debug/tcp-dump.sh +++ b/scripts/cli/src/commands/debug/tcp-dump.sh @@ -4,12 +4,12 @@ duration="${args[--duration]}" filename="tcp-dump-$container-$port-`date '+%Y-%m-%d-%H-%M-%S'`.pcap" set +e -docker exec $container which tcpdump > /dev/null 2>&1 +docker exec $container whereis tcpdump > /dev/null 2>&1 if [ $? != 0 ] then logwarn "tcpdump is not installed on container $container, attempting to install it" docker exec --privileged --user root $container bash -c "rpm -i --nosignature https://rpmfind.net/linux/centos/8-stream/AppStream/aarch64/os/Packages/tcpdump-4.9.3-2.el8.aarch64.rpm" > /dev/null 2>&1 - docker exec --privileged --user root $container bash -c "curl http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/tcpdump-4.9.3-1.el8.x86_64.rpm -o tcpdump-4.9.3-1.el8.x86_64.rpm && rpm -Uvh tcpdump-4.9.3-1.el8.x86_64.rpm" > /dev/null 2>&1 + docker exec --privileged --user root $container bash -c "yum update -y && yum install tcpdump -y" > /dev/null 2>&1 if [ "$container" == "ngrok" ] then @@ -17,7 +17,7 @@ then fi docker exec --privileged --user root $container bash -c "apt-get update && echo tcpdump | xargs -n 1 apt-get install --force-yes -y && rm -rf /var/lib/apt/lists/*" > /dev/null 2>&1 fi -docker exec $container which tcpdump > /dev/null 2>&1 +docker exec $container whereis tcpdump > /dev/null 2>&1 if [ $? != 0 ] then logerror "❌ tcpdump could not be installed" diff --git a/scripts/cli/src/lib/utils_function.sh b/scripts/cli/src/lib/utils_function.sh index b2996085a..dbaf20d4e 100644 --- a/scripts/cli/src/lib/utils_function.sh +++ b/scripts/cli/src/lib/utils_function.sh @@ -247,7 +247,7 @@ function maybe_create_image() then CONNECT_3RDPARTY_INSTALL="if [ ! -f /tmp/done ]; then yum -y install --disablerepo='Confluent*' bind-utils openssl unzip findutils net-tools nc jq which iptables libmnl krb5-workstation krb5-libs vim && yum clean all && rm -rf /var/cache/yum && rpm -i --nosignature https://rpmfind.net/linux/centos/8-stream/AppStream/aarch64/os/Packages/tcpdump-4.9.3-2.el8.aarch64.rpm && touch /tmp/done; fi" else - CONNECT_3RDPARTY_INSTALL="if [ ! -f /tmp/done ]; then curl http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/tcpdump-4.9.3-1.el8.x86_64.rpm -o tcpdump-4.9.3-1.el8.x86_64.rpm && rpm -Uvh tcpdump-4.9.3-1.el8.x86_64.rpm && yum -y install --disablerepo='Confluent*' bind-utils openssl unzip findutils net-tools nc jq which iptables libmnl krb5-workstation krb5-libs vim && yum clean all && rm -rf /var/cache/yum && touch /tmp/done; fi" + CONNECT_3RDPARTY_INSTALL="if [ ! -f /tmp/done ]; then && yum -y install --disablerepo='Confluent*' tcpdump bind-utils openssl unzip findutils net-tools nc jq which iptables libmnl krb5-workstation krb5-libs vim && yum clean all && rm -rf /var/cache/yum && touch /tmp/done; fi" fi else export CONNECT_USER="root"