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
This commit is contained in:
Suhail Haris 2023-07-08 23:10:27 +05:30
commit 2b033dd616
No known key found for this signature in database
GPG key ID: 8E225274EDCBF899

16
yabs.sh
View file

@ -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