mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-11 07:51:54 +00:00
50 lines
2.1 KiB
Plaintext
50 lines
2.1 KiB
Plaintext
#------------------【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】--------------------
|