This commit is contained in:
4eu3 2015-08-13 19:23:43 +00:00
commit cfc222ea3f
2 changed files with 23 additions and 3 deletions

View File

@ -1,3 +1,6 @@
###Intro
This is fork of [Nyr](https://github.com/Nyr/openvpn-install) with added TCP/UDP selector.
##openvpn-install ##openvpn-install
OpenVPN [road warrior](http://en.wikipedia.org/wiki/Road_warrior_%28computing%29) installer for Debian, Ubuntu and CentOS. OpenVPN [road warrior](http://en.wikipedia.org/wiki/Road_warrior_%28computing%29) installer for Debian, Ubuntu and CentOS.
@ -6,7 +9,9 @@ This script will let you setup your own VPN server in no more than a minute, eve
###Installation ###Installation
Run the script and follow the assistant: Run the script and follow the assistant:
`wget git.io/vpn --no-check-certificate -O openvpn-install.sh; bash openvpn-install.sh` `wget git.io/v346F --no-check-certificate -O openvpn-install.sh; bash openvpn-install.sh` (my version)
`wget git.io/vpn --no-check-certificate -O openvpn-install.sh; bash openvpn-install.sh` (original)
Once it ends, you can run it again to add more users, remove some of them or even completely uninstall OpenVPN. Once it ends, you can run it again to add more users, remove some of them or even completely uninstall OpenVPN.
@ -17,4 +22,4 @@ If you don't care about sharing an IP address with more people, check out the aw
###Donations ###Donations
If you want to show your appreciation, you can donate via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VBAYDL34Z7J6L) or [Bitcoin](https://www.coinbase.com/Nyr). Thanks! If you want to show your appreciation, you can donate via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VBAYDL34Z7J6L) or [Bitcoin](https://www.coinbase.com/Nyr). Thanks!

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# OpenVPN road warrior installer for Debian, Ubuntu and CentOS # OpenVPN road warrior installer for Debian, Ubuntu and CentOS
# TCP/UDP selector: done :)
# This script will work on Debian, Ubuntu, CentOS and probably other distros # This script will work on Debian, Ubuntu, CentOS and probably other distros
# of the same families, although no support is offered for them. It isn't # of the same families, although no support is offered for them. It isn't
# bulletproof but it will probably work if you simply want to setup a VPN on # bulletproof but it will probably work if you simply want to setup a VPN on
@ -190,6 +190,11 @@ else
echo " 6) Google" echo " 6) Google"
read -p "DNS [1-6]: " -e -i 1 DNS read -p "DNS [1-6]: " -e -i 1 DNS
echo "" echo ""
echo "TCP/UDP selector:"
echo " 1) TCP"
echo " 2) UDP"
read -p "SELECTOR [1-2]: " -e -i 1 SELECTOR
echo ""
echo "Finally, tell me your name for the client cert" echo "Finally, tell me your name for the client cert"
echo "Please, use one word only, no special characters" echo "Please, use one word only, no special characters"
read -p "Client name: " -e -i client CLIENT read -p "Client name: " -e -i client CLIENT
@ -276,6 +281,16 @@ else
sed -i 's|;push "dhcp-option DNS 208.67.220.220"|push "dhcp-option DNS 8.8.4.4"|' server.conf sed -i 's|;push "dhcp-option DNS 208.67.220.220"|push "dhcp-option DNS 8.8.4.4"|' server.conf
;; ;;
esac esac
# SELECTOR
case $SELECTOR in
1)
sed -i 's|proto udp|proto tcp|' server.conf
sed -i 's|proto udp|proto tcp|' /usr/share/doc/openvpn*/*ample*/sample-config-files/client.conf
;;
2)
# nothing do
;;
esac
# Listen at port 53 too if user wants that # Listen at port 53 too if user wants that
if [[ "$ALTPORT" = 'y' ]]; then if [[ "$ALTPORT" = 'y' ]]; then
iptables -t nat -A PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-port $PORT iptables -t nat -A PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-port $PORT