Skip to content

Commit 06f8a1d

Browse files
committed
Server mode country code identification fix
- Fixed country code identification in server mode when found AS name contains a comma (closes nitefood#15)
1 parent b2d2d37 commit 06f8a1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

asn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# │ (Launch the script without parameters or visit the project's homepage for usage info)│
1313
# ╰──────────────────────────────────────────────────────────────────────────────────────╯
1414

15-
ASN_VERSION="0.70.3"
15+
ASN_VERSION="0.70.4"
1616

1717
# ╭──────────────────╮
1818
# │ Helper functions │
@@ -1303,7 +1303,7 @@ AsnServerListener(){
13031303
found_asn="N/A"
13041304
found_asname="(Unknown)"
13051305
fi
1306-
server_country=$(echo "$found_asname" | cut -d ',' -f 2 | tr -d ' ')
1306+
server_country=$(echo "${found_asname##*,}" | tr -d ' ')
13071307
[[ -z "$server_country" ]] && server_country="(Unknown)"
13081308

13091309
StatusbarMessage
@@ -2358,7 +2358,7 @@ if [ -z "$input" ]; then
23582358
echo -en "${bluebg} AS Name ──>${default} ${green}${found_asname}"
23592359
if [ "$IS_ASN_CHILD" = true ]; then
23602360
# signal to the parent connhandler the correct country flag to display for this ASN
2361-
flag_icon_cc=$(echo "$found_asname" | cut -d ',' -f 2 | tr -d ' ' | tr '[:upper:]' '[:lower:]')
2361+
flag_icon_cc=$(echo "${found_asname##*,}" | tr -d ' ' | tr '[:upper:]' '[:lower:]')
23622362
[[ -n "$flag_icon_cc" ]] && echo -n " #COUNTRYCODE $flag_icon_cc"
23632363
fi
23642364
printf "\n"

0 commit comments

Comments
 (0)