├── LICENSE ├── README.md └── install.sh /LICENSE: -------------------------------------------------------------------------------- 1 | CC0 1.0 Universal 2 | 3 | Statement of Purpose 4 | 5 | The laws of most jurisdictions throughout the world automatically confer 6 | exclusive Copyright and Related Rights (defined below) upon the creator and 7 | subsequent owner(s) (each and all, an "owner") of an original work of 8 | authorship and/or a database (each, a "Work"). 9 | 10 | Certain owners wish to permanently relinquish those rights to a Work for the 11 | purpose of contributing to a commons of creative, cultural and scientific 12 | works ("Commons") that the public can reliably and without fear of later 13 | claims of infringement build upon, modify, incorporate in other works, reuse 14 | and redistribute as freely as possible in any form whatsoever and for any 15 | purposes, including without limitation commercial purposes. These owners may 16 | contribute to the Commons to promote the ideal of a free culture and the 17 | further production of creative, cultural and scientific works, or to gain 18 | reputation or greater distribution for their Work in part through the use and 19 | efforts of others. 20 | 21 | For these and/or other purposes and motivations, and without any expectation 22 | of additional consideration or compensation, the person associating CC0 with a 23 | Work (the "Affirmer"), to the extent that he or she is an owner of Copyright 24 | and Related Rights in the Work, voluntarily elects to apply CC0 to the Work 25 | and publicly distribute the Work under its terms, with knowledge of his or her 26 | Copyright and Related Rights in the Work and the meaning and intended legal 27 | effect of CC0 on those rights. 28 | 29 | 1. Copyright and Related Rights. A Work made available under CC0 may be 30 | protected by copyright and related or neighboring rights ("Copyright and 31 | Related Rights"). Copyright and Related Rights include, but are not limited 32 | to, the following: 33 | 34 | i. the right to reproduce, adapt, distribute, perform, display, communicate, 35 | and translate a Work; 36 | 37 | ii. moral rights retained by the original author(s) and/or performer(s); 38 | 39 | iii. publicity and privacy rights pertaining to a person's image or likeness 40 | depicted in a Work; 41 | 42 | iv. rights protecting against unfair competition in regards to a Work, 43 | subject to the limitations in paragraph 4(a), below; 44 | 45 | v. rights protecting the extraction, dissemination, use and reuse of data in 46 | a Work; 47 | 48 | vi. database rights (such as those arising under Directive 96/9/EC of the 49 | European Parliament and of the Council of 11 March 1996 on the legal 50 | protection of databases, and under any national implementation thereof, 51 | including any amended or successor version of such directive); and 52 | 53 | vii. other similar, equivalent or corresponding rights throughout the world 54 | based on applicable law or treaty, and any national implementations thereof. 55 | 56 | 2. Waiver. To the greatest extent permitted by, but not in contravention of, 57 | applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and 58 | unconditionally waives, abandons, and surrenders all of Affirmer's Copyright 59 | and Related Rights and associated claims and causes of action, whether now 60 | known or unknown (including existing as well as future claims and causes of 61 | action), in the Work (i) in all territories worldwide, (ii) for the maximum 62 | duration provided by applicable law or treaty (including future time 63 | extensions), (iii) in any current or future medium and for any number of 64 | copies, and (iv) for any purpose whatsoever, including without limitation 65 | commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes 66 | the Waiver for the benefit of each member of the public at large and to the 67 | detriment of Affirmer's heirs and successors, fully intending that such Waiver 68 | shall not be subject to revocation, rescission, cancellation, termination, or 69 | any other legal or equitable action to disrupt the quiet enjoyment of the Work 70 | by the public as contemplated by Affirmer's express Statement of Purpose. 71 | 72 | 3. Public License Fallback. Should any part of the Waiver for any reason be 73 | judged legally invalid or ineffective under applicable law, then the Waiver 74 | shall be preserved to the maximum extent permitted taking into account 75 | Affirmer's express Statement of Purpose. In addition, to the extent the Waiver 76 | is so judged Affirmer hereby grants to each affected person a royalty-free, 77 | non transferable, non sublicensable, non exclusive, irrevocable and 78 | unconditional license to exercise Affirmer's Copyright and Related Rights in 79 | the Work (i) in all territories worldwide, (ii) for the maximum duration 80 | provided by applicable law or treaty (including future time extensions), (iii) 81 | in any current or future medium and for any number of copies, and (iv) for any 82 | purpose whatsoever, including without limitation commercial, advertising or 83 | promotional purposes (the "License"). The License shall be deemed effective as 84 | of the date CC0 was applied by Affirmer to the Work. Should any part of the 85 | License for any reason be judged legally invalid or ineffective under 86 | applicable law, such partial invalidity or ineffectiveness shall not 87 | invalidate the remainder of the License, and in such case Affirmer hereby 88 | affirms that he or she will not (i) exercise any of his or her remaining 89 | Copyright and Related Rights in the Work or (ii) assert any associated claims 90 | and causes of action with respect to the Work, in either case contrary to 91 | Affirmer's express Statement of Purpose. 92 | 93 | 4. Limitations and Disclaimers. 94 | 95 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 96 | surrendered, licensed or otherwise affected by this document. 97 | 98 | b. Affirmer offers the Work as-is and makes no representations or warranties 99 | of any kind concerning the Work, express, implied, statutory or otherwise, 100 | including without limitation warranties of title, merchantability, fitness 101 | for a particular purpose, non infringement, or the absence of latent or 102 | other defects, accuracy, or the present or absence of errors, whether or not 103 | discoverable, all to the greatest extent permissible under applicable law. 104 | 105 | c. Affirmer disclaims responsibility for clearing rights of other persons 106 | that may apply to the Work or any use thereof, including without limitation 107 | any person's Copyright and Related Rights in the Work. Further, Affirmer 108 | disclaims responsibility for obtaining any necessary consents, permissions 109 | or other rights required for any use of the Work. 110 | 111 | d. Affirmer understands and acknowledges that Creative Commons is not a 112 | party to this document and has no duty or obligation with respect to this 113 | CC0 or use of the Work. 114 | 115 | For more information, please see 116 | 117 | 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SoftEther-Installer 2 | Script to install SoftEther VPN Server/Bridge 3 | 4 | Download or copy this script in to linux server. 5 | Chmod the file to allow executable. 6 | run in terminal below command 7 | 8 | ./install.sh 9 | 10 | Currently tested on: 11 | 1. Debian Arm Server(C1) on Scaleway. 12 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | latest="v4.22-9634-beta" 4 | lateststable="v4.20-9608-rtm-2016.04.17" 5 | #Release Date: 2015-10-19 6 | initfile="vpnserver2" 7 | 8 | echo "--------------------------------------------------------------------" 9 | echo "SoftEther VPN Server Install script" 10 | echo "By AhmadShamli" 11 | echo "http://github.com/AhmadShamli" 12 | echo "http://AhmadShamli.com" 13 | echo "credit: DigitalOcean and StackOverflow" 14 | echo "https://www.digitalocean.com/community/tutorials/how-to-setup-a-multi-protocol-vpn-server-using-softether" 15 | echo "--------------------------------------------------------------------" 16 | echo "--------------------------------------------------------------------" 17 | echo 18 | echo "Select Architecture" 19 | echo 20 | echo " 1. Arm EABI (32bit)" 21 | echo " 2. Intel x86 (32bit)" 22 | echo " 3. Intel x64/AMD64 (64bit)" 23 | echo 24 | echo "Please choose architecture: " 25 | read tmp 26 | echo 27 | 28 | if test "$tmp" = "3" 29 | then 30 | arch="64bit_-_Intel_x64_or_AMD64" 31 | arch2="x64-64bit" 32 | echo "Selected : 1 " $arch 33 | elif test "$tmp" = "2" 34 | then 35 | arch="32bit_-_Intel_x86" 36 | arch2="x86-32bit" 37 | echo "Selected : 2 " $arch 38 | elif test "$tmp" = "1" 39 | then 40 | arch="32bit_-_ARM_EABI" 41 | arch2="arm_eabi-32bit" 42 | echo "Selected : 3 " $arch 43 | else #default if non selected 44 | arch="32bit_-_Intel_x86" 45 | arch2="x86-32bit" 46 | echo "Selected : 2 " $arch 47 | fi 48 | 49 | echo "--------------------------------------------------------------------" 50 | echo 51 | echo "Select OS" 52 | echo 53 | echo " 1. Debian/Ubuntu" 54 | echo " 2. CentOS/Fedora" 55 | echo 56 | echo "Please choose OS: " 57 | read tmp 58 | echo 59 | 60 | if test "$tmp" = "2" 61 | then 62 | os="cent" 63 | echo "Selected : 2 CentOS/Fedora" 64 | else 65 | os="deb" 66 | echo "Selected : 1 Debian/Ubuntu" 67 | fi 68 | 69 | echo "--------------------------------------------------------------------" 70 | echo 71 | echo "Select build" 72 | echo 73 | echo " 1. latest(might include beta/rc)" 74 | echo " 2. latest stable" 75 | echo 76 | echo "Please choose build: " 77 | read tmp 78 | echo 79 | 80 | if test "$tmp" = "2" 81 | then 82 | version="$lateststable" 83 | echo "Latest stable selected: 2 "$lateststable 84 | else 85 | version="$latest" 86 | echo "Latest build(stable/beta) selected: 1 "$latest 87 | fi 88 | 89 | file="softether-vpnserver-"$version"-linux-"$arch2".tar.gz" 90 | link="http://www.softether-download.com/files/softether/"$version"-tree/Linux/SoftEther_VPN_Server/"$arch"/"$file 91 | 92 | if [ ! -s "$file" ]||[ ! -r "$file" ];then 93 | #remove and redownload empty or unreadable file 94 | rm -f "$link" 95 | wget "$link" 96 | elif [ ! -f "file" ];then 97 | #download if not exist 98 | wget "$file" 99 | fi 100 | 101 | if [ -f "$file" ];then 102 | tar xzf "$file" 103 | dir=$(pwd) 104 | echo "current dir " $dir 105 | cd vpnserver 106 | dir=$(pwd) 107 | echo "changed to dir " $dir 108 | else 109 | echo "Archive not found. Please rerun this script or check permission." 110 | break 111 | fi 112 | 113 | if [ "$os" -eq "cent" ];then 114 | yum upgrade 115 | yum groupinstall "Development Tools" gcc 116 | else 117 | apt-get update && apt-get upgrade 118 | apt-get install build-essential -y 119 | fi 120 | 121 | make 122 | cd .. 123 | mv vpnserver /usr/local 124 | dir=$(pwd) 125 | echo "current dir " $dir 126 | cd /usr/local/vpnserver/ 127 | dir=$(pwd) 128 | echo "changed to dir " $dir 129 | chmod 600 * 130 | chmod 700 vpnserver 131 | chmod 700 vpncmd 132 | 133 | mkdir /var/lock/subsys 134 | 135 | touch /etc/init.d/"$initfile" 136 | #need to cat two time to pass varible($initfile) value inside 137 | cat > /etc/init.d/"$initfile" <> /etc/init.d/"$initfile" <<'EOF' 146 | test -x $DAEMON || exit 0 147 | case "$1" in 148 | start) 149 | $DAEMON start 150 | touch $LOCK 151 | ;; 152 | stop) 153 | $DAEMON stop 154 | rm $LOCK 155 | ;; 156 | restart) 157 | $DAEMON stop 158 | sleep 3 159 | $DAEMON start 160 | ;; 161 | *) 162 | echo "Usage: $0 {start|stop|restart}" 163 | exit 1 164 | esac 165 | exit 0 166 | EOF 167 | 168 | chmod 755 /etc/init.d/"$initfile" 169 | if [ "$os" -eq "cent" ];then 170 | chkconfig --add "$initfile" 171 | /etc/init.d/"$initfile" start 172 | else 173 | update-rc.d "$initfile" defaults 174 | /etc/init.d/"$initfile" start 175 | fi 176 | 177 | 178 | 179 | echo "--------------------------------------------------------------------" 180 | echo "--------------------------------------------------------------------" 181 | echo "Installation done. Hurray." 182 | echo "Now you may want to change VPN server password." 183 | echo "Run in terminal:" 184 | echo "./vpncmd" 185 | echo "Press 1 to select \"Management of VPN Server or VPN Bridge\"," 186 | echo "then press Enter without typing anything to connect to the " 187 | echo "localhost server, and again press Enter without inputting " 188 | echo "anything to connect to server by server admin mode." 189 | echo "Then use command below to change admin password:" 190 | echo "ServerPasswordSet" 191 | echo "Done...." 192 | 193 | --------------------------------------------------------------------------------