From 2b033dd616f14c1df9f13851e87c84ef5f6e0331 Mon Sep 17 00:00:00 2001 From: Suhail Haris Date: Sat, 8 Jul 2023 23:10:27 +0530 Subject: [PATCH] Improve the Network Information Sometimes from ip-api, either ISP or ASN is available, but it would not show since the condition is not satisfied. Fix to show if either value is present --- yabs.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/yabs.sh b/yabs.sh index 68ce91d..c0a1371 100644 --- a/yabs.sh +++ b/yabs.sh @@ -12,7 +12,7 @@ # performance via fio. The script is designed to not require any dependencies # - either compiled or installed - nor admin privileges to run. -YABS_VERSION="v2023-04-23" +YABS_VERSION="v2023-07-08" echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #' echo -e '# Yet-Another-Bench-Script #' @@ -298,10 +298,16 @@ function ip_info() { echo "$net_type Network Information:" echo "---------------------------------" - if [[ -n "$isp" && -n "$as" ]]; then - echo "ISP : $isp" - echo "ASN : $as" - fi + if [[ -n "$isp" ]]; then + echo "ISP : $isp" + else + echo "ISP : Unknown" + fi + if [[ -n "$as" ]]; then + echo "ASN : $as" + else + echo "ASN : Unknown" + fi if [[ -n "$org" ]]; then echo "Host : $org" fi