Advertisement
icoexist

SoftEther Install Script (UPDATED)

Apr 14th, 2018
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.75 KB | None | 0 0
  1. #!/bin/bash
  2. read -r -p "This will install SoftEther to your server. Are you sure you want to continue? [y/N] " response
  3. case $response in
  4. [yY][eE][sS]|[yY])
  5. echo "Updating the system first..."
  6. apt-get update
  7. apt-get upgrade -y
  8. apt-get install checkinstall build-essential -y
  9. echo "Downloading last stable release: 4.25"
  10. sleep 2
  11. wget -O softether-vpn-4-25.tar.gz http://softether-download.com/files/softether/v4.25-9656-rtm-2018.01.15-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.25-9656-rtm-2018.01.15-linux-x64-64bit.tar.gz
  12. tar -xzf softether-vpn-4-25.tar.gz
  13. cd vpnserver
  14. echo "Please press 1 for all the following questions."
  15. sleep 1
  16. make
  17. cd ..
  18. mv vpnserver /usr/local/
  19. chmod 600 * /usr/local/vpnserver
  20. chmod 700 /usr/local/vpnserver/vpncmd
  21. chmod 700 /usr/local/vpnserver/vpnserver
  22. echo '#!/bin/sh
  23. # description: SoftEther VPN Server
  24. ### BEGIN INIT INFO
  25. # Provides:          vpnserver
  26. # Required-Start:    $local_fs $network
  27. # Required-Stop:     $local_fs
  28. # Default-Start:     2 3 4 5
  29. # Default-Stop:      0 1 6
  30. # Short-Description: softether vpnserver
  31. # Description:       softether vpnserver daemon
  32. ### END INIT INFO
  33. DAEMON=/usr/local/vpnserver/vpnserver
  34. LOCK=/var/lock/subsys/vpnserver
  35. test -x $DAEMON || exit 0
  36. case "$1" in
  37. start)
  38. $DAEMON start
  39. touch $LOCK
  40. ;;
  41. stop)
  42. $DAEMON stop
  43. rm $LOCK
  44. ;;
  45. restart)
  46. $DAEMON stop
  47. sleep 3
  48. $DAEMON start
  49. ;;
  50. *)
  51. echo "Usage: $0 {start|stop|restart}"
  52. exit 1
  53. esac
  54. exit 0' > /etc/init.d/vpnserver
  55. echo "System daemon created. Registering changes..."
  56. sleep 2
  57. chmod 755 /etc/init.d/vpnserver
  58. update-rc.d vpnserver defaults
  59. echo "SoftEther VPN Server should now start as a system service from now on. Starting SoftEther VPN service..."
  60. ../etc/init.d/vpnserver start
  61. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement