setup-v2ray.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/bash
  2. if [ "${EUID}" -ne 0 ]; then
  3. echo "You need to run this script as root"
  4. exit 1
  5. fi
  6. if [ "$(systemd-detect-virt)" == "openvz" ]; then
  7. echo "OpenVZ is not supported"
  8. exit 1
  9. fi
  10. red='\e[1;31m'
  11. green='\e[0;32m'
  12. NC='\e[0m'
  13. MYIP=$(wget -qO- icanhazip.com);
  14. echo "Authentikasi pada server"
  15. IZIN=$( curl icanhazip.com | grep $MYIP )
  16. if [ $MYIP = $IZIN ]; then
  17. echo -e "${green}Permintaan Diterima...${NC}"
  18. else
  19. echo -e "${red}Permintaan Ditolak!${NC}";
  20. echo "Hanya untuk pengguna terdaftar"
  21. rm -f setup.sh
  22. exit 0
  23. fi
  24. mkdir /var/lib/premium-script;
  25. mkdir /etc/v2ray;
  26. echo "Tolong masukan domain yang sudah dipointing agar v2ray service work"
  27. read -p "Hostname / Domain: " host
  28. echo "IP=$host" >> /var/lib/premium-script/ipvps.conf
  29. echo "$host" >> /etc/v2ray/domain
  30. #installer ssh Only
  31. cd
  32. wget https://raw.githubusercontent.com/4hidessh/hidessh/main/berantakan/ujiv2ray.sh && chmod +x ujiv2ray.sh && screen -S ujiv2ray.sh ./ujiv2ray.sh
  33. sleep 3
  34. #install websocker SSH dan Dropbear
  35. cd
  36. wget https://raw.githubusercontent.com/4hidessh/hidessh/main/webscoket/all-install.sh && chmod +x all-install.sh && ./all-install.sh
  37. sleep 3
  38. #install v2ray
  39. wget https://raw.githubusercontent.com/4hidessh/hidessh/main/vmess/setu.sh && chmod +x setu.sh && screen -S setu.sh ./setu.sh
  40. #install L2TP
  41. #wget https://adiscript.vercel.app/vpn/ipsec.sh && chmod +x ipsec.sh && screen -S ipsec ./ipsec.sh
  42. #wget https://adiscript.vercel.app/vpn/set-br.sh && chmod +x set-br.sh && ./set-br.sh
  43. rm -f /root/ssh-vpn.sh
  44. #rm -f /root/sstp.sh
  45. #rm -f /root/wg.sh
  46. #rm -f /root/ss.sh
  47. #rm -f /root/ssr.sh
  48. rm -f /root/ins-vt.sh
  49. #rm -f /root/ipsec.sh
  50. #rm -f /root/set-br.sh
  51. cat <<EOF> /etc/systemd/system/autosett.service
  52. [Unit]
  53. Description=autosetting
  54. Documentation=https://adiscript.vercel.app/vpn
  55. [Service]
  56. Type=oneshot
  57. ExecStart=/bin/bash /etc/set.sh
  58. RemainAfterExit=yes
  59. [Install]
  60. WantedBy=multi-user.target
  61. EOF
  62. systemctl daemon-reload
  63. systemctl enable autosett
  64. wget -O /etc/set.sh "https://adiscript.vercel.app/vpn/set.sh"
  65. chmod +x /etc/set.sh
  66. history -c
  67. echo "1.2" > /home/ver
  68. clear
  69. echo " "
  70. echo "Installation has been completed!!"
  71. echo " "
  72. echo "=================================-Script Premium-===========================" | tee -a log-install.txt
  73. echo " Harap Reboot Manual ! "
  74. sleep 3
  75. rm -f adi.sh
  76. rm -f setup.sh
  77. rm -f setup-opok.sh
  78. rm -f opok.sh