7 Star 10 Fork 2

游鱼彩虹 / vagrant_linux_shell

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install-vpn.sh 980 Bytes
一键复制 编辑 原始数据 按行查看 历史
游鱼彩虹 提交于 2014-11-11 16:17 . 加入安装vpn的sh脚本。
#!/bin/bash
type pptpd > /dev/null 2>&1
[ $? -ne 0 ] && apt-get install pptpd
grep '^localip 192.168.' /etc/pptpd.conf > /dev/null
if [ $? -ne 0 ]; then
cat >> /etc/pptpd.conf <<PPTPDCONF
localip 192.168.17.1
remoteip 192.168.17.11-60
PPTPDCONF
fi
grep '^ms-dns 8.8.8.8' /etc/ppp/options > /dev/null
if [ $? -ne 0 ]; then
cat >> /etc/ppp/options <<PPPOPTIONS
ms-dns 8.8.8.8
ms-dns 8.8.4.4
PPPOPTIONS
fi
echo -n "设置您的VPN账号的用户名: "
read username
echo -n "为您的VPN账号设置密码: "
read password
cat >> /etc/ppp/chap-secrets <<SECRETS
$username pptpd $password *
SECRETS
sed -i 's/#\(net\.ipv4\.ip_forward=1\)/\1/g' /etc/sysctl.conf
/sbin/sysctl -p
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sed -i "s/exit 0/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nexit 0/g" /etc/rc.local
/etc/init.d/pptpd restart
echo "PPTP VPN 安装完毕,请使用以下账户登录:"
echo "用户名: $username"
echo "密码: $password"
Ruby
1
https://gitee.com/yzdel2000/vagrant_linux_shell.git
git@gitee.com:yzdel2000/vagrant_linux_shell.git
yzdel2000
vagrant_linux_shell
vagrant_linux_shell
master

搜索帮助