/bin/bash # DOBY PPTP VPN for CentOS # Powered Dobyi.com Wei Pptp.sh Check if user is root if [$(ID -u) = = "0"]; then echo "Error: You must must," We currently support CentOS only' exit 1 fi function echoline {echo = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = } function = repairvpn = {{{{{{{{{] = "108", "we", "support". "VPN Username:" username if [[${username}] = "]; then echo" Error: VPN Username Can't VPN! "! Then echo "Error: ${username} exists." username= username= "" fi done while [[$vpnpwd "=" ") do do ", "Error:" "["] = ""; "", " Then echo "Error: pptpd restart failed", exit 1 fi echo "${username} ${username}", "{{"] "["] = "". Then echo "Error: VPN Username Can't be empty!" "fi done ifexists=`cat ifexists=`cat", "Error:", "" "(") "," "", "" "" = "" "," ",", "" Then echo "Error: pptpd restart failed", exit 1 fi echo "${username} ${username}", "{{" = "") "[" {{] "=" ");" "VPN Password:" vpnpwd if [[$vpnpwd] = "]; then echo" Error: VPN Password Can't VPN!! " Then #epel WGet Http://dl.fedoraproject.org/pub/epel/5/x86_ 64/epel-release-5-4. Noarch.rpm WGet Http://poptop.sourceforge.net/yum/stable/rhel5/pptp-release-current.noarch.rpm RPM -Uvh epel-release-5*.rpm rpm -Uvh pptp-release- Current.noarch.rpm Elif [[$version] -eq'6']; then #epel WGet Http://dl.fedoraproject.org/pub/epel/6/x86_ 64/epel-release-6-8. Noarch.rpm WGet Http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm RPM -Uvh epel-release-6*.rpm rpm -Uvh pptp-release- Current.noarch.rpm Elif [[$version] -eq'7']; then #epel WGet Http://dl.fedoraproject.org/pub/epel/7/x86_ 64/e/epel-release-7-5. Noarch.rpm RPM -Uvh epel-release-7*.rpm fi RM -f *.rpm #install pptp Yum install Yum " Pptpd.conf Echo "remoteip 10.0.0.2-254" /etc/ Pptpd.conf Echo "ms-dns 8.8.8.8" /etc/ppp/ Options.pptpd Echo "ms-dns 8.8.4.4" /etc/ppp/ Options.pptpd #create account CP /etc/ppp/chap-secrets /etc/ppp/chap- Secrets.bak Echo "${username} pptpd ${vpnpwd} *" > /etc/ppp/chap-secrets #final #final fix RM -rf /dev/ppp mknod /dev/ppp 108 pptpd, "0"? Net.ipv4 .ip_ Forward /etc/ Sysctl.conf "If" [$ifexists "= ="]; then echo " Net.ipv4 .ip_ Forward = 1 "" /etc/ " Sysctl.conf Else sed -i's/# Net.ipv4 .ip_ Forward/ Net.ipv4 .ip_ Forward/g'/etc/ Sysctl.conf Sed -i's/ Net.ipv4 .ip_ Forward = 0/ Net.ipv4 .ip_ Forward = 1/g'/etc/ Sysctl.conf Fi sysctl -p #iptables if [[$version] -eq'7']; then systemctl stop stop, "Hou", "Wei", "Yu", "Yu". Then interfaces= "eth0" fi fi iptables iptables NAT -t POSTROUTING -A -o -o, the first and the third part of the world, the following are the following: 1723 -j ACCEPT iptables -A INPUT -p GRE -j ACCEPT service iptables service, "iptables"? Then echo "Error: iptables restart failed", exit 1 fi chkconfig pptpd chkconfig, "", "", " Http://dobyi.com "Echoline } clear echo" " echo" DOBY PPTP VPN for CentOS, " echoline echo" DOBY PPTP VPN is a Yum a, "" Please visit our website Http://dobyi.com " echo" 1. install VPN " echo" 2. repair VPN " echo" 3. add VPN user, " echo" 4., user, "VPN", "VPN", "" ","; ";"; ";" 2 ");;" 3 ");"; ";" 4; ";" * * ")"; ";