mirror of https://gitlab.com/fscarmen/test.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
490 B
12 lines
490 B
#!/usr/bin/env bash
|
|
ip=$1
|
|
TEMP_FILE='ip.temp'
|
|
FILE=$(uname -m | sed "s/x86_64/besttrace/" | sed "s/aarch64/besttracearm/")
|
|
|
|
[[ -z "$ip" ]] && echo -e "请填入上对端 IP" && exit 1
|
|
|
|
[[ ! -e "$FILE" ]] && wget -qN https://cdn.jsdelivr.net/gh/fscarmen/tools/besttrace/$FILE
|
|
chmod +x "$FILE" >/dev/null 2>&1
|
|
./"$FILE" "$ip" -g cn > $TEMP_FILE
|
|
cat $TEMP_FILE | sed "s/.*\*\(.*\)/\1/g" | sed "s/.*AS[0-9]*//g" | sed "/\*$/d;/^$/d;1d" | uniq | awk '{printf("%d.%s\n"),NR,$0}'
|
|
rm -f $TEMP_FILE
|
|
|