From 77e6be35a191d513d2e55fc9e4027e47dde5bb9d Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 31 Aug 2022 22:54:58 -0600 Subject: [PATCH 1/3] silence git reset output --- functions/self_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/self_update.sh b/functions/self_update.sh index 144157d4..e06b2dc9 100644 --- a/functions/self_update.sh +++ b/functions/self_update.sh @@ -5,7 +5,7 @@ args=("$@") self_update() { git fetch --tags &>/dev/null -git reset --hard +git reset --hard &>/dev/null latest_ver=$(git describe --tags "$(git rev-list --tags --max-count=1)") echo "🅂 🄴 🄻 🄵" echo "🅄 🄿 🄳 🄰 🅃 🄴" From 3f299e0ba3322563632f3b50b9d8357a8a46b5ff Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 31 Aug 2022 23:10:26 -0600 Subject: [PATCH 2/3] change variables and appname to non-full --- functions/dns.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/functions/dns.sh b/functions/dns.sh index 3d9af33a..05441da8 100644 --- a/functions/dns.sh +++ b/functions/dns.sh @@ -9,19 +9,20 @@ dep_ignore='svclb-' # Pulling pod names k3s crictl pods --namespace ix -s Ready | sed -E 's/[[:space:]]([0-9]*|About)[a-z0-9 ]{5,12}ago[[:space:]]//' | grep -Ev -- "$dep_ignore" | sed '1d' >> dns_file -mapfile -t ixName < <(< dns_file awk '{print $4}' | sort -u ) +mapfile -t ix_name_array < <(< dns_file awk '{print $4}' | sort -u ) # Pulling all ports all_ports=$(k3s kubectl get service -A) clear -x count=0 -for i in "${ixName[@]}" +for i in "${ix_name_array[@]}" do [[ count -le 0 ]] && echo -e "\n" && ((count++)) - appName=$(grep -E "\s$i\s" "dns_file" | awk '{print $3}' | sed 's/-[^-]*-[^-]*$//' | sed 's/-0//' | head -n 1) - port=$(echo "$all_ports" | grep -E "\s$appName\s" | awk '{print $6}' | grep -Eo "^[[:digit:]]+{1}") - echo -e "$appName $appName.$i.svc.cluster.local $port" + full_app_name=$(grep -E "\s$i\s" "dns_file" | awk '{print $3}' | sed 's/-[^-]*-[^-]*$//' | sed 's/-0//' | head -n 1) + app_name=$(echo $i | cut -c 4-) + port=$(echo "$all_ports" | grep -E "\s$full_app_name\s" | awk '{print $6}' | grep -Eo "^[[:digit:]]+{1}") + echo -e "$app_name $full_app_name.$i.svc.cluster.local $port" done | nl -s ") " -b t | sed '0,/\s\s\s/{s/\s\s\s/- ---- -------- ----/}'| column -t -N "#,Name,DNS_Name,Port" rm dns_file } From 2b758961766bebc85d4dfe03cf4df6ef08cb8bb5 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 31 Aug 2022 23:10:45 -0600 Subject: [PATCH 3/3] remove ignore var --- functions/dns.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/functions/dns.sh b/functions/dns.sh index 05441da8..ad6536d3 100644 --- a/functions/dns.sh +++ b/functions/dns.sh @@ -4,11 +4,9 @@ dns(){ clear -x echo "Generating DNS Names.." -# Ignore svclb -dep_ignore='svclb-' # Pulling pod names -k3s crictl pods --namespace ix -s Ready | sed -E 's/[[:space:]]([0-9]*|About)[a-z0-9 ]{5,12}ago[[:space:]]//' | grep -Ev -- "$dep_ignore" | sed '1d' >> dns_file +k3s crictl pods --namespace ix -s Ready | sed -E 's/[[:space:]]([0-9]*|About)[a-z0-9 ]{5,12}ago[[:space:]]//' | grep -v 'svclb-' | sed '1d' >> dns_file mapfile -t ix_name_array < <(< dns_file awk '{print $4}' | sort -u ) # Pulling all ports @@ -20,7 +18,7 @@ for i in "${ix_name_array[@]}" do [[ count -le 0 ]] && echo -e "\n" && ((count++)) full_app_name=$(grep -E "\s$i\s" "dns_file" | awk '{print $3}' | sed 's/-[^-]*-[^-]*$//' | sed 's/-0//' | head -n 1) - app_name=$(echo $i | cut -c 4-) + app_name=$(echo "$i" | cut -c 4-) port=$(echo "$all_ports" | grep -E "\s$full_app_name\s" | awk '{print $6}' | grep -Eo "^[[:digit:]]+{1}") echo -e "$app_name $full_app_name.$i.svc.cluster.local $port" done | nl -s ") " -b t | sed '0,/\s\s\s/{s/\s\s\s/- ---- -------- ----/}'| column -t -N "#,Name,DNS_Name,Port"