delss.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. # SL
  3. # ==========================================
  4. # Color
  5. RED='\033[0;31m'
  6. NC='\033[0m'
  7. GREEN='\033[0;32m'
  8. ORANGE='\033[0;33m'
  9. BLUE='\033[0;34m'
  10. PURPLE='\033[0;35m'
  11. CYAN='\033[0;36m'
  12. LIGHT='\033[0;37m'
  13. # ==========================================
  14. # Getting
  15. MYIP=$(wget -qO- ipinfo.io/ip);
  16. echo "Checking VPS"
  17. IZIN=$( curl ipinfo.io/ip | grep $MYIP )
  18. if [ $MYIP = $MYIP ]; then
  19. echo -e "${NC}${GREEN}Permission Accepted...${NC}"
  20. else
  21. echo -e "${NC}${RED}Permission Denied!${NC}";
  22. echo -e "${NC}${LIGHT}Fuck You!!"
  23. exit 0
  24. fi
  25. clear
  26. NUMBER_OF_CLIENTS=$(grep -c -E "^### " "/etc/shadowsocks-libev/akun.conf")
  27. if [[ ${NUMBER_OF_CLIENTS} == '0' ]]; then
  28. clear
  29. echo ""
  30. echo "You have no existing clients!"
  31. exit 1
  32. fi
  33. clear
  34. echo ""
  35. echo " Select the existing client you want to remove"
  36. echo " Press CTRL+C to return"
  37. echo " ==============================="
  38. echo " No Expired User"
  39. grep -E "^### " "/etc/shadowsocks-libev/akun.conf" | cut -d ' ' -f 2-3 | nl -s ') '
  40. until [[ ${CLIENT_NUMBER} -ge 1 && ${CLIENT_NUMBER} -le ${NUMBER_OF_CLIENTS} ]]; do
  41. if [[ ${CLIENT_NUMBER} == '1' ]]; then
  42. read -rp "Pilih salah satu[1]: " CLIENT_NUMBER
  43. else
  44. read -rp "Pilih salah satu [1-${NUMBER_OF_CLIENTS}]: " CLIENT_NUMBER
  45. fi
  46. done
  47. # match the selected number to a client name
  48. CLIENT_NAME=$(grep -E "^### " "/etc/shadowsocks-libev/akun.conf" | cut -d ' ' -f 2-3 | sed -n "${CLIENT_NUMBER}"p)
  49. user=$(grep -E "^### " "/etc/shadowsocks-libev/akun.conf" | cut -d ' ' -f 2 | sed -n "${CLIENT_NUMBER}"p)
  50. exp=$(grep -E "^### " "/etc/shadowsocks-libev/akun.conf" | cut -d ' ' -f 3 | sed -n "${CLIENT_NUMBER}"p)
  51. # remove [Peer] block matching $CLIENT_NAME
  52. sed -i "/^### $user $exp/,/^port_http/d" "/etc/shadowsocks-libev/akun.conf"
  53. # remove generated client file
  54. service cron restart
  55. systemctl disable shadowsocks-libev-server@$user-tls.service
  56. systemctl disable shadowsocks-libev-server@$user-http.service
  57. systemctl stop shadowsocks-libev-server@$user-tls.service
  58. systemctl stop shadowsocks-libev-server@$user-http.service
  59. rm -f "/etc/shadowsocks-libev/$user-tls.json"
  60. rm -f "/etc/shadowsocks-libev/$user-http.json"
  61. clear
  62. echo ""
  63. echo "==========================="
  64. echo " SS OBFS Account Deleted "
  65. echo "==========================="
  66. echo "Username : $user"
  67. echo "Expired : $exp"
  68. echo "==========================="
  69. echo "Script Mod By SL"