From 66c9f895057962ff0037864e960037a1fb3a6eb8 Mon Sep 17 00:00:00 2001 From: ada mancini Date: Wed, 30 Oct 2024 14:58:25 -0400 Subject: [PATCH] check for all deps and print better usage dialog --- scripts/tcpdump.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/tcpdump.sh b/scripts/tcpdump.sh index 0894706..5948c04 100644 --- a/scripts/tcpdump.sh +++ b/scripts/tcpdump.sh @@ -20,10 +20,15 @@ readonly VXLAN_FLAGS="-lttttnnvv" namespace=$1 pod=$2 -timeframe="1m" +timeframe="5m" if [[ -z $namespace || -z $pod ]]; then - echo "Usage: $0 " + echo "Usage: ./tcpdump.sh [time frame]" + echo " namespace: string, required" + echo " pod-name: string, required" + echo " time frame: integer with optional suffix 's', 'm', 'h', or 'd'; defaults to '5m'" + echo " Example Usage: ./tcpdump.sh default coredns-coredns-74ff55c5d 300s" + echo " " exit 1 fi @@ -40,7 +45,7 @@ if [[ $EUID -ne 0 ]]; then fi # check for required binaries -for binary in kubectl jq tcpdump; do +for binary in kubectl jq tcpdump ip timeout grep awk; do if ! command -v "$binary" &> /dev/null; then echo "Could not find $binary" exit 1