usernew.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 Senovpn"
  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 "Informasi SSH & OpenVPN"
  40. echo -e "==============================="
  41. echo -e "IP/Host : $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 None TLS : 2095"
  49. echo -e "Ws OVPN : 2082"
  50. echo -e "Ws TLS : 443"
  51. echo -e "SSL/TLS : 222, 777"
  52. echo -e "Port Squid : 3128, 8080"
  53. echo -e "Port TCP : 1194"
  54. echo -e "Port UDP : 2200"
  55. echo -e "Port SSL : 442"
  56. echo -e "BadVpn : 7100-7300"
  57. echo -e "==============================="
  58. echo -e "PAYLOAD WS :"
  59. echo -e "GET / HTTP/1.1[crlf]Host: ${domain}[crlf]Upgrade: websocket[crlf][crlf]"
  60. echo -e "==============================="
  61. echo -e "Link Download Ovpn"
  62. echo -e "==============================="
  63. echo -e "http://$IP:81/client-tcp-$ovpn.ovpn"
  64. echo -e "http://$IP:81/client-udp-$ovpn2.ovpn"
  65. echo -e "http://$IP:81/client-tcp-ssl.ovpn"
  66. echo -e ""
  67. echo -e "==============================="
  68. echo -e "Created : $created"
  69. echo -e "Expired : $exp"
  70. echo -e "==============================="
  71. echo -e ""
  72. echo -e "Script By Senovpn"
  73. echo -e ""