cek-ss.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. red='\e[1;31m'
  3. green='\e[0;32m'
  4. NC='\e[0m'
  5. MYIP=$(wget -qO- icanhazip.com);
  6. echo "Checking VPS"
  7. clear
  8. echo "-------------------------------";
  9. echo "---=[ SS - OBFS User Login ]=---";
  10. echo "-------------------------------";
  11. echo ""
  12. data=( `cat /etc/shadowsocks-libev/akun.conf | grep '^###' | cut -d ' ' -f 2`);
  13. x=1
  14. echo "-------------------------------";
  15. echo " User | TLS"
  16. echo "-------------------------------";
  17. for akun in "${data[@]}"
  18. do
  19. port=$(cat /etc/shadowsocks-libev/akun.conf | grep '^port_tls' | cut -d ' ' -f 2 | tr '\n' ' ' | awk '{print $'"$x"'}')
  20. jum=$(netstat -anp | grep ESTABLISHED | grep obfs-server | cut -d ':' -f 2 | grep -w $port | awk '{print $2}' | sort | uniq | nl)
  21. if [[ -z "$jum" ]]; then
  22. echo > /dev/null
  23. else
  24. echo " $akun - $port"
  25. echo "$jum";
  26. echo "-------------------------------"
  27. fi
  28. x=$(( "$x" + 1 ))
  29. done
  30. data=( `cat /etc/shadowsocks-libev/akun.conf | grep '^###' | cut -d ' ' -f 2`);
  31. x=1
  32. echo ""
  33. echo "-------------------------------";
  34. echo " User | HTTP"
  35. echo "-------------------------------";
  36. for akun in "${data[@]}"
  37. do
  38. port=$(cat /etc/shadowsocks-libev/akun.conf | grep '^port_http' | cut -d ' ' -f 2 | tr '\n' ' ' | awk '{print $'"$x"'}')
  39. jum=$(netstat -anp | grep ESTABLISHED | grep obfs-server | cut -d ':' -f 2 | grep -w $port | awk '{print $2}' | sort | uniq | nl)
  40. if [[ -z "$jum" ]]; then
  41. echo > /dev/null
  42. else
  43. echo " $akun - $port"
  44. echo "$jum";
  45. echo "-------------------------------"
  46. fi
  47. x=$(( "$x" + 1 ))
  48. done