#!/bin/bash #Version: 1.0 #Author: Gourav Shah #http://www.initcron.org ########################################################################### # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ############################################################################# echo "I: Installing PPTP VPN Server" apt-get install -yq pptpd echo "I: Backing up /etc/sysctl.conf to /etc/sysctl.conf.initcron before updating the file" cp /etc/sysctl.conf /etc/sysctl.conf.initcron sleep 1 echo "I: Enabling IP Forwarding in sysctl.conf..." sed -i "s/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g" /etc/sysctl.conf sleep 1 echo "I: Configuring PPTP Server.." cp /etc/pptpd.conf /etc/pptpd.conf.initcron echo "localip 10.0.0.1" >> /etc/pptpd.conf echo "remoteip 10.0.0.21-80" >> /etc/pptpd.conf cp /etc/ppp/pptpd-options /etc/ppp/pptpd-options.initcron echo "ms-dns 8.8.8.8" >> /etc/ppp/pptpd-options echo "ms-dns 8.8.4.4" >> /etc/ppp/pptpd-options sleep 1 echo -n "First VPN User to add: " read VPNUSER echo -n "Password for $VPNUSER: " read VPNUSERPASS echo "$VPNUSER pptpd $VPNUSERPASS *" >> /etc/ppp/chap-secrets sleep 2 echo "I: Added First User... " echo "I: To add more users, edit /etc/ppp/chap-secrets. Make sure this file is only readable by root after you edit it." echo "Starting PPTP VPN Server.." /etc/init.d/pptpd restart sleep 2 echo "I: DONE " echo "I: Make sure you have port 1723 open on the server to be accessible for the clients. " echo "I: Enjoy the awesomeness. " echo "I: For Issues, Features, enhancements contact labs@initcron.org " sleep 2 exit 0