Files
MIXBOX-ARCHIVE/apps/pptpd/config/mixbox.conf
2020-03-05 00:08:40 +08:00

50 lines
2.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#------------------【PPTPD】--------------------
pptpd() {
eval `mbdb export pptpd`
source /etc/mixbox/bin/base
echo "********* $service ***********"
echo "[${appinfo}]"
if [ -f /tmp/pptp_connected ]; then
echo "已连接用户信息:"
cat /tmp/pptp_connected
fi
readsh "启动${appname}服务[1/0] " "enable" "1"
if [ "$enable" == '1' ]; then
# Scripts Here
read -p "更改${appname}配置?[1/0] " res
if [ "$res" = '1' ]; then
readsh "请输入${appname}本地IP地址" "localip" "192.168.111.1"
readsh "请输入${appname}起始IP地址" "ip_min" "2"
readsh "请输入${appname}结束IP地址" "ip_max" "100"
readsh "请输入${appname}解析DNS地址" "dns1" "223.5.5.5"
readsh "请输入${appname}解析DNS备用地址" "dns2" "223.6.6.6"
fi
cat /etc/ppp/chap-secrets 2> /dev/null
read -p "管理${appname}用户?[1/0] " res
if [ "$res" = '1' ]; then
while true; do
read -p "请输入${appname}用户名[回车结束]" user
[ -z "$user" ] && break || read -p "请输入${appname}密码:" pwd
echo "添加用户:$user $pwd"
${mbroot}/apps/${appname}/scripts/${appname}.sh add $user $pwd
done
while true; do
read -p "请输入要删除的用户名[回车结束]" user
[ -z "$user" ] && break
echo "删除用户:$user"
${mbroot}/apps/${appname}/scripts/${appname}.sh del $user
done
fi
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
read -p "重启${appname}服务?[1/0] " res
[ "$res" = '1' -o -z "$res" ] && ${mbroot}/apps/${appname}/scripts/${appname}.sh restart
else
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
fi
}
#------------------【PPTPD】--------------------