usernew.sh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. red='\e[1;31m'
  3. green='\e[0;32m'
  4. NC='\e[0m'
  5. MYIP=$(wget -qO- icanhazip.com);
  6. echo "Script By Geo"
  7. clear
  8. if [[ "$IP2" = "" ]]; then
  9. domain=$(cat /etc/v2ray/domain)
  10. else
  11. domain=$IP2
  12. fi
  13. read -p "Username : " Login
  14. read -p "Password : " Pass
  15. read -p "Expired (hari): " masaaktif
  16. IP=$(wget -qO- icanhazip.com);
  17. ssl="$(cat ~/log-install.txt | grep -w "Stunnel4" | cut -d: -f2)"
  18. sqd="$(cat ~/log-install.txt | grep -w "Squid" | cut -d: -f2)"
  19. ovpn="$(netstat -nlpt | grep -i openvpn | grep -i 0.0.0.0 | awk '{print $4}' | cut -d: -f2)"
  20. ovpn2="$(netstat -nlpu | grep -i openvpn | grep -i 0.0.0.0 | awk '{print $4}' | cut -d: -f2)"
  21. sleep 1
  22. echo Ping Host
  23. echo Cek Hak Akses...
  24. sleep 0.5
  25. echo Permission Accepted
  26. clear
  27. sleep 0.5
  28. echo Membuat Akun: $Login
  29. sleep 0.5
  30. echo Setting Password: $Pass
  31. sleep 0.5
  32. clear
  33. useradd -e `date -d "$masaaktif days" +"%Y-%m-%d"` -s /bin/false -M $Login
  34. exp="$(chage -l $Login | grep "Account expires" | awk -F": " '{print $2}')"
  35. created=`date -d "0 days" +"%d-%m-%Y"`
  36. echo -e "$Pass\n$Pass\n"|passwd $Login &> /dev/null
  37. echo -e ""
  38. echo -e "━━━━━━━━━━━━━━━━━━"
  39. echo -e "SSH & OpenVPN Account Details"
  40. echo -e "━━━━━━━━━━━━━━━━━━"
  41. echo -e "Host/IP : $IP"
  42. echo -e "Domain : ${domain}"
  43. echo -e "Username : $Login "
  44. echo -e "Password : $Pass"
  45. echo -e "━━━━━━━━━━━━━━━━━━"
  46. echo -e "OpenSSH : 22"
  47. echo -e "Dropbear : 109, 143"
  48. echo -e "WS TLS : 2096"
  49. echo -e "WS non TLS : 2095"
  50. echo -e "WS OVPN : 2082"
  51. echo -e "SSL/TLS : 8443, 777"
  52. echo -e "Port Squid : 8080, 3128"
  53. echo -e "badvpn : 7100-7300"
  54. echo -e "━━━━━━━━━━━━━━━━━━"
  55. echo -e "PAYLOAD WS-CDN :"
  56. echo -e "GET / HTTP/1.1[crlf]Host: ${domain}[crlf]Upgrade: websocket[crlf][crlf]"
  57. echo -e "━━━━━━━━━━━━━━━━━━"
  58. echo -e "Link Download Ovpn"
  59. echo -e "━━━━━━━━━━━━━━━━━━"
  60. echo -e "http://${domain}:81/client-tcp-$ovpn.ovpn"
  61. echo -e "http://${domain}:81/client-udp-$ovpn2.ovpn"
  62. echo -e "http://${domain}:81/client-tcp-ssl.ovpn"
  63. echo -e ""
  64. echo -e "━━━━━━━━━━━━━━━━━━"
  65. echo -e "Created : $created"
  66. echo -e "Expired : $exp"
  67. echo -e "━━━━━━━━━━━━━━━━━━"
  68. echo -e ""
  69. echo -e "Script By @sampiiiiu"
  70. echo -e ""