wget .sh
chmod +x ./CentOS7-pptp-host1plus.sh
./CentOS7-pptp-host1plus.sh -u username -p password
注意检查CentOS7-pptp-host1plus.sh的地址是否还有效。
username、password是自己的登录用户名和密码。但密码长度必须大于8个 ASCII字符,否则为了安全,脚本将会随机生成密码。
CentOS7-pptp-host1plus.sh 源码
#!/bin/bash
# Setup Simple PPTP VPN server for CentOS 7 on Host1plus
# Copyright (C) 2015-2016 Danyl Zhang <1475811550@qq> and contributors
#
# 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 2 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.printhelp() {echo "
Usage: ./CentOS7-pptp-host1plus.sh [OPTION]
If you are using custom password , Make sure its more than 8 characters. Otherwise it will generate random password for you.
If you trying set password only. It will generate Default user with Random password.
example: ./CentOS7-pptp-host1plus.sh -u myusr -p mypass
Use without parameter [ ./CentOS7-pptp-host1plus.sh ] to use default username and Random password-u, --username Enter the Username-p, --password Enter the Password
"
}while [ "$1" != "" ]; docase "$1" in-u | --username ) NAME=$2; shift 2 ;;-p | --password ) PASS=$2; shift 2 ;;-h | --help ) echo "$(printhelp)"; exit; shift; break ;;esac
done# Check if user is root
[ $(id -u) != "0" ] && { echo -e "