cek-ss.sh 1.3 KB

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