menu-scx.sh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. source /var/lib/premium-script/ipvps.conf
  3. if [[ "$IP" = "" ]]; then
  4. domain=$(cat /etc/v2ray/domain)
  5. else
  6. domain=$IP
  7. fi
  8. # // Vless
  9. vless1="$( cat /etc/xray/vless-ws.json | grep -w port | awk '{print $2}' | sed 's/,//g' )"
  10. until [[ $user =~ ^[a-zA-Z0-9_]+$ && ${CLIENT_EXISTS} == '0' ]]; do
  11. read -rp "User: " -e user
  12. CLIENT_EXISTS=$(grep -w $user /etc/xray/vless-ws.json | wc -l)
  13. if [[ ${CLIENT_EXISTS} == '1' ]]; then
  14. echo ""
  15. echo "A client with the specified name was already created, please choose another name."
  16. exit 1
  17. fi
  18. done
  19. uuid=$(cat /proc/sys/kernel/random/uuid)
  20. read -p "Expired (days): " masaaktif
  21. exp=`date -d "$masaaktif days" +"%Y-%m-%d"`
  22. # // Input To Server
  23. sed -i '/#XRay$/a\### '"$user $exp"'\
  24. },{"id": "'""$uuid""'","flow": "xtls-rprx-direct","email": "'""$user""'"' /etc/xray/vless-ws.json
  25. vless_direct="vless://${uuid}@${domain}:${vless1}?security=xtls&encryption=none&headerType=none&type=tcp&flow=xtls-rprx-direct&sni=bug#$user"
  26. vless_ws="vless://${uuid}@${domain}:${vless1}?security=tls&encryption=none&headerType=none&type=tcp&flow=xtls-rprx-direct&sni=bug#$user"
  27. vless_ws1="vless://${uuid}@${domain}:${vless1}?security=tls&encryption=none&headerType=ws&type=tcp&flow=xtls-rprx-direct&sni=bug#$user"
  28. vlesslink1="vless://${uuid}@${domain}:${vless1}$tls?path=/xray&security=tls&encryption=none&type=ws#${user}"
  29. vlesslink2="vless://${uuid}@${domain}:${vless1}$none?path=/xray&encryption=none&type=ws#${user}"
  30. # // Restarting Service
  31. systemctl stop xray@vless-direct
  32. systemctl stop xray@vless-ws
  33. systemctl disable xray@vless-direct
  34. systemctl disable xray@vless-ws
  35. systemctl enable xray@vless-direct
  36. systemctl enable xray@vless-ws
  37. systemctl start xray@vless-direct
  38. systemctl start xray@vless-ws
  39. systemctl restart xray@vless-direct
  40. systemctl restart xray@vless-ws
  41. clear
  42. echo -e ""
  43. echo -e "==========-XRAYS/VLESS-=========="
  44. echo -e "Remarks : ${user}"
  45. echo -e "Domain : ${domain}"
  46. echo -e "Port Direct : $vless1"
  47. echo -e "Port Splice : $vless1"
  48. echo -e "id : ${uuid}"
  49. echo -e "path : /darknet"
  50. echo -e "================================="
  51. echo -e "Link Direct : ${vless_direct}"
  52. echo -e "================================="
  53. echo -e "Link WS : ${vless_ws}"
  54. echo -e "================================="
  55. echo -e "link All : ${vless_ws1}"
  56. echo -e "================================="
  57. echo -e "link All : ${vlesslink1}"
  58. echo -e "================================="
  59. echo -e "link All : ${vless_vless2}"
  60. echo -e "Expired On : $exp"