deltrojan.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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/xray/config.json")
  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/xray/config.json" | 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. user=$(grep -E "^#&# " "/etc/xray/config.json" | cut -d ' ' -f 2 | sed -n "${CLIENT_NUMBER}"p)
  46. exp=$(grep -E "^#&# " "/etc/xray/config.json" | cut -d ' ' -f 3 | sed -n "${CLIENT_NUMBER}"p)
  47. sed -i "/^#&# $user $exp/,/^},{/d" /etc/xray/config.json
  48. sed -i "/^#&# $user $exp/,/^},{/d" /etc/xray/config.json
  49. systemctl restart xray.service
  50. service cron restart
  51. clear
  52. echo ""
  53. echo "================================"
  54. echo " XRAYS/Trojan Account Deleted "
  55. echo "================================"
  56. echo "Username : $user"
  57. echo "Expired : $exp"
  58. echo "================================"
  59. echo "Script Mod By SL"