Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.71 KB | None | 0 0
  1. #!/bin/bash
  2. # UsnekxPHC
  3. clear
  4. echo " "
  5. echo " "
  6. echo " _| _| _|_|_| _| _| _|_|_|_| _| _| _| _| "
  7. echo " _| _| _| _|_| _| _| _| _| _| _| "
  8. echo " _| _| _|_| _| _| _| _|_|_| _|_| _| "
  9. echo " _| _| _| _| _|_| _| _| _| _| _| "
  10. echo " _|_| _|_|_| _| _| _|_|_|_| _| _| _| _| "
  11. echo " "
  12. echo " AUTO SCRIPT "
  13. echo " "
  14. echo " "
  15.  
  16. HOST=""
  17. SERVER_PASSWORD=""
  18. USER=""
  19. HUB=""
  20. SE_PASSWORD=""
  21.  
  22. HOST=${HOST}
  23. HUB=${HUB}
  24. USER_PASSWORD=${SERVER_PASSWORD}
  25. SE_PASSWORD=${SE_PASSWORD}
  26.  
  27. echo -n "Enter Server IP: "
  28. read HOST
  29. echo -n "Set Virtual Hub: "
  30. read HUB
  31. echo -n "Set ${HUB} hub username: "
  32. read USER
  33. read -s -p "Set ${HUB} hub password: " SERVER_PASSWORD
  34. echo ""
  35. read -s -p "Set SE Server password: " SE_PASSWORD
  36. echo ""
  37. echo " "
  38. echo "Now sit back and wait until the installation finished."
  39. echo " "
  40.  
  41. sudo apt-get -y update && sudo apt-get -y upgrade && apt-get install expect -y
  42. sudo apt-get install checkinstall build-essential -y
  43. wget http://www.softether-download.com/files/softether/v4.27-9668-beta-2018.05.29-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.27-9668-beta-2018.05.29-linux-x64-64bit.tar.gz
  44. tar -xzf softether-vpnserver-v4.27-9668-beta-2018.05.29-linux-x64-64bit.tar.gz
  45. rm -rf softether-vpnserver-v4.27-9668-beta-2018.05.29-linux-x64-64bit.tar.gz
  46. cd /root/vpnserver && expect -c 'spawn make; expect number:; send 1\r; expect number:; send 1\r; expect number:; send 1\r; interact'
  47. cd && mv vpnserver/ /usr/local && chmod 600 * /usr/local/vpnserver/ && chmod 700 /usr/local/vpnserver/vpncmd && chmod 700 /usr/local/vpnserver/vpnserver
  48. echo '#!/bin/sh
  49. # description: SoftEther VPN Server
  50. ### BEGIN INIT INFO
  51. # Provides: vpnserver
  52. # Required-Start: $local_fs $network
  53. # Required-Stop: $local_fs
  54. # Default-Start: 2 3 4 5
  55. # Default-Stop: 0 1 6
  56. # Short-Description: softether vpnserver
  57. # Description: softether vpnserver daemon
  58. ### END INIT INFO
  59. DAEMON=/usr/local/vpnserver/vpnserver
  60. LOCK=/var/lock/subsys/vpnserver
  61. test -x $DAEMON || exit 0
  62. case "$1" in
  63. start)
  64. $DAEMON start
  65. touch $LOCK
  66. ;;
  67. stop)
  68. $DAEMON stop
  69. rm $LOCK
  70. ;;
  71. restart)
  72. $DAEMON stop
  73. sleep 3
  74. $DAEMON start
  75. ;;
  76. *)
  77. echo "Usage: $0 {start|stop|restart}"
  78. exit 1
  79. esac
  80. exit 0' > /etc/init.d/vpnserver
  81. ###
  82.  
  83.  
  84. HOST=${HOST}
  85. HUB_PASSWORD=${SE_PASSWORD}
  86. USER_PASSWORD=${SERVER_PASSWORD}
  87.  
  88. TARGET="/usr/local/"
  89.  
  90. sleep 2
  91. ${TARGET}vpnserver/vpncmd localhost /SERVER /CMD ServerPasswordSet ${SE_PASSWORD}
  92. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD HubCreate ${HUB} /PASSWORD:${HUB_PASSWORD}
  93. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /HUB:${HUB} /CMD UserCreate ${USER} /GROUP:none /REALNAME:none /NOTE:none
  94. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /HUB:${HUB} /CMD UserPasswordSet ${USER} /PASSWORD:${USER_PASSWORD}
  95. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD IPsecEnable /L2TP:yes /L2TPRAW:yes /ETHERIP:no /PSK:vpn /DEFAULTHUB:${HUB}
  96. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD HubDelete DEFAULT
  97. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /HUB:${HUB} /CMD SecureNatEnable
  98. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD VpnOverIcmpDnsEnable /ICMP:yes /DNS:yes
  99. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD ListenerCreate 53
  100. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD ListenerCreate 137
  101. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD ListenerCreate 500
  102. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD ListenerCreate 921
  103. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD ListenerCreate 4500
  104. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD ListenerCreate 4000
  105. ${TARGET}vpnserver/vpncmd localhost /SERVER /PASSWORD:${SE_PASSWORD} /CMD ListenerCreate 40000
  106. clear
  107. echo "Softether server configuration has been done!"
  108. echo " "
  109. echo "Host: ${HOST}"
  110. echo "Virtual Hub: ${HUB}"
  111. echo "Port: 443, 53, 137"
  112. echo "Username: ${USER}"
  113. echo "Password: ${SERVER_PASSWORD}"
  114. echo "Server Password: ${SE_PASSWORD}"
  115. echo " "
  116. echo "Join us in TD's Discord Server"
  117. echo "Invitation link: https://discord.gg/2BCNNYg"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement