Skip to content

Commit

Permalink
update remote reverse (fixes #2137)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLKwong committed Mar 26, 2021
1 parent 2646587 commit 587c0b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ function remote {
while IFS= read -r line; do
cmd_str+="\"$line\","
done <<< "$reverse"
ip=$(printf "%s\n" "${cmd_str::-1}" | grep -e '"ip": "')
org=$(printf "%s\n" "${cmd_str::-1}" | grep -e '"org": "')
country=$(printf "%s\n" "${cmd_str::-1}" | grep -o '"country": "[^;]*')
city=$(printf "%s\n" "${cmd_str::-1}" | grep -o '"city": "[^;]*')
postal=$(printf "%s\n" "${cmd_str::-1}" | grep -o '"postal": "[^;]*')
timezone=$(printf "%s\n" "${cmd_str::-1}" | grep -o '"timezone": "[^;]*')
ip=$(printf "%s\n" "${cmd_str::-1}" | cut -d',' -f 1)
org=$(printf "%s\n" "${cmd_str::-1}" | cut -d',' -f 2)
country=$(printf "%s\n" "${cmd_str::-1}" | cut -d',' -f 3)
city=$(printf "%s\n" "${cmd_str::-1}" | cut -d',' -f 4)
postal=$(printf "%s\n" "${cmd_str::-1}" | cut -d',' -f 5)
timezone=$(printf "%s\n" "${cmd_str::-1}" | cut -d',' -f 6)

echo "{$ip,$org,$country,$city,$postal,$timezone}"
;;
Expand Down

0 comments on commit 587c0b4

Please sign in to comment.