Skip to content

Commit

Permalink
tcpdump install
Browse files Browse the repository at this point in the history
  • Loading branch information
vdesabou committed May 24, 2024
1 parent b73c42d commit e878c37
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions scripts/cli/playground
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -17437,20 +17437,20 @@ 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
playground container exec -c ngrok --command "adduser --force-badname --system --no-create-home _apt" --root > /dev/null 2>&1
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"
Expand Down
6 changes: 3 additions & 3 deletions scripts/cli/src/commands/debug/tcp-dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ 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
playground container exec -c ngrok --command "adduser --force-badname --system --no-create-home _apt" --root > /dev/null 2>&1
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"
Expand Down
2 changes: 1 addition & 1 deletion scripts/cli/src/lib/utils_function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e878c37

Please sign in to comment.