deltrgo.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/trojan-go/akun.conf")
  27. if [[ ${NUMBER_OF_CLIENTS} == '0' ]]; then
  28. echo ""
  29. echo "You have no existing clients!"
  30. exit 1
  31. fi
  32. echo ""
  33. echo " Select the existing client you want to remove"
  34. echo " Press CTRL+C to return"
  35. echo " ==============================="
  36. echo " No Expired User"
  37. grep -E "^### " "/etc/trojan-go/akun.conf" | cut -d ' ' -f 2-3 | nl -s ') '
  38. until [[ ${CLIENT_NUMBER} -ge 1 && ${CLIENT_NUMBER} -le ${NUMBER_OF_CLIENTS} ]]; do
  39. if [[ ${CLIENT_NUMBER} == '1' ]]; then
  40. read -rp "Select one client [1]: " CLIENT_NUMBER
  41. else
  42. read -rp "Select one client [1-${NUMBER_OF_CLIENTS}]: " CLIENT_NUMBER
  43. fi
  44. done
  45. CLIENT_NAME=$(grep -E "^### " "/etc/trojan-go/akun.conf" | cut -d ' ' -f 2-3 | sed -n "${CLIENT_NUMBER}"p)
  46. user=$(grep -E "^### " "/etc/trojan-go/akun.conf" | cut -d ' ' -f 2 | sed -n "${CLIENT_NUMBER}"p)
  47. exp=$(grep -E "^### " "/etc/trojan-go/akun.conf" | cut -d ' ' -f 3 | sed -n "${CLIENT_NUMBER}"p)
  48. sed -i "/^### $user $exp/d" /etc/trojan-go/akun.conf
  49. sed -i '/^,"'"$user"'"$/d' /etc/trojan-go/config.json
  50. systemctl restart trojan-go.service
  51. service cron restart
  52. clear
  53. echo ""
  54. echo "============================"
  55. echo " TrojanGo Account Deleted "
  56. echo "============================"
  57. echo "Username : $user"
  58. echo "Expired : $exp"
  59. echo "============================"
  60. echo "Script Mod By SL"