123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #!/bin/bash
- red='\e[1;31m'
- green='\e[0;32m'
- NC='\e[0m'
- MYIP=$(wget -qO- icanhazip.com);
- echo "Checking VPS"
- clear
- echo -n > /tmp/other.txt
- data=( `cat /etc/v2ray/vless.json | grep '^###' | cut -d ' ' -f 2`);
- echo "-------------------------------";
- echo "-----=[ Vless User Login ]=-----";
- echo "-------------------------------";
- for akun in "${data[@]}"
- do
- if [[ -z "$akun" ]]; then
- akun="tidakada"
- fi
- echo -n > /tmp/ipvless.txt
- data2=( `netstat -anp | grep ESTABLISHED | grep tcp6 | grep v2ray | awk '{print $5}' | cut -d: -f1 | sort | uniq`);
- for ip in "${data2[@]}"
- do
- jum=$(cat /var/log/v2ray/access2.log | grep -w $akun | awk '{print $3}' | cut -d: -f1 | grep -w $ip | sort | uniq)
- if [[ "$jum" = "$ip" ]]; then
- echo "$jum" >> /tmp/ipvless.txt
- else
- echo "$ip" >> /tmp/other.txt
- fi
- jum2=$(cat /tmp/ipvless.txt)
- sed -i "/$jum2/d" /tmp/other.txt > /dev/null 2>&1
- done
- jum=$(cat /tmp/ipvless.txt)
- if [[ -z "$jum" ]]; then
- echo > /dev/null
- else
- jum2=$(cat /tmp/ipvless.txt | nl)
- echo "user : $akun";
- echo "$jum2";
- echo "-------------------------------"
- fi
- rm -rf /tmp/ipvmess.txt
- done
- oth=$(cat /tmp/other.txt | sort | uniq | nl)
- echo "other";
- echo "$oth";
- echo "-------------------------------"
- rm -rf /tmp/other.txt
|