update-12.23
This commit is contained in:
parent
6358697ddc
commit
c32d161a4c
|
@ -5,12 +5,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic
|
||||
PKG_BASE_VERSION:=0.27.0-rc.2
|
||||
PKG_RELEASE:=52
|
||||
PKG_BASE_VERSION:=0.27.0-rc.4
|
||||
PKG_RELEASE:=53
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/UnblockNeteaseMusic/server.git
|
||||
PKG_SOURCE_DATE:=2021-11-27
|
||||
PKG_SOURCE_DATE:=2021-12-21
|
||||
PKG_SOURCE_VERSION:=6ed9f70c78a083f91c38e2a507d2977ea429d742
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
|
|
@ -976,11 +976,6 @@ gen_serv_include(){
|
|||
|
||||
start_server(){
|
||||
[ $(uci_get_by_type server_global enable_server 0) = 0 ] && return
|
||||
if [[ "$(uci -q get smartdns.@smartdns[0].enabled)" == "1" ]]; then
|
||||
uci -q del smartdns.@smartdns[0].enabled
|
||||
uci commit smartdns
|
||||
/etc/init.d/smartdns stop 2>/dev/null
|
||||
fi
|
||||
mkdir -p $VAR
|
||||
config_load $NAME
|
||||
config_foreach run_server server_config
|
||||
|
@ -1016,6 +1011,7 @@ start(){
|
|||
}
|
||||
|
||||
stop(){
|
||||
[[ $(uci_get_by_type global global_server 0) = 0 && $(uci_get_by_type server_global enable_server 0) = 0 ]] && exit 1
|
||||
kill -9 $(ps -w | grep by-rules | grep -v grep | awk '{print$1}') 2>/dev/null
|
||||
kill -9 $(ps -w | grep gfw.b64 | grep -v grep | awk '{print$1}') 2>/dev/null
|
||||
kill -9 $(ps -w | grep $BIN_DIR/checknetwork | grep -v grep | awk '{print$1}') 2>/dev/null
|
||||
|
@ -1094,7 +1090,6 @@ stop(){
|
|||
|
||||
restart(){
|
||||
[ -f $LOC ] && exit 1
|
||||
touch $LOC
|
||||
STATUS=N
|
||||
stop
|
||||
start
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for IPSec VPN Server
|
||||
LUCI_DEPENDS:=+strongswan +strongswan-minimal +strongswan-mod-kernel-libipsec +strongswan-mod-openssl +strongswan-mod-xauth-generic +xl2tpd +luci-lib-jsonc +kmod-tun
|
||||
LUCI_DEPENDS:=+kmod-tun +luci-lib-jsonc +strongswan +strongswan-minimal +strongswan-mod-kernel-libipsec +strongswan-mod-openssl +strongswan-mod-xauth-generic +xl2tpd
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=20211216
|
||||
PKG_RELEASE:=2
|
||||
PKG_VERSION:=20211223
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ L2TP_CONFIG_FILE=${L2TP_PATH}/xl2tpd.conf
|
|||
L2TP_OPTIONS_FILE=${L2TP_PATH}/options.xl2tpd
|
||||
L2TP_LOG_FILE=${L2TP_PATH}/xl2tpd.log
|
||||
|
||||
vt_clientip=$(uci -q get $CONFIG.@service[0].clientip)
|
||||
vt_l2tp_enabled=$(uci -q get $CONFIG.@service[0].l2tp_enable)
|
||||
vt_l2tp_localip=$(uci -q get $CONFIG.@service[0].l2tp_localip)
|
||||
vt_clientip=$(uci -q get ${CONFIG}.@service[0].clientip)
|
||||
l2tp_enabled=$(uci -q get ${CONFIG}.@service[0].l2tp_enable)
|
||||
l2tp_localip=$(uci -q get ${CONFIG}.@service[0].l2tp_localip)
|
||||
|
||||
ipt_flag="IPSec VPN Server"
|
||||
|
||||
|
@ -24,15 +24,15 @@ get_enabled_anonymous_secs() {
|
|||
|
||||
ipt_rule() {
|
||||
if [ "$1" = "add" ]; then
|
||||
iptables -t nat -I POSTROUTING -s ${vt_clientip%.*}.0/24 -m comment --comment "${ipt_flag}" -j MASQUERADE 2>/dev/null
|
||||
iptables -I forwarding_rule -s ${vt_clientip%.*}.0/24 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -t nat -I POSTROUTING -s ${vt_clientip} -m comment --comment "${ipt_flag}" -j MASQUERADE 2>/dev/null
|
||||
iptables -I forwarding_rule -s ${vt_clientip} -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -I forwarding_rule -m policy --dir in --pol ipsec --proto esp -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -I forwarding_rule -m policy --dir out --pol ipsec --proto esp -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -I INPUT -p udp -m multiport --dports 500,4500 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -t mangle -I OUTPUT -p udp -m multiport --sports 500,4500 -m comment --comment "${ipt_flag}" -j RETURN 2>/dev/null
|
||||
[ "$vt_l2tp_enabled" = 1 ] && {
|
||||
iptables -t nat -I POSTROUTING -s ${vt_l2tp_localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j MASQUERADE 2>/dev/null
|
||||
iptables -I forwarding_rule -s ${vt_l2tp_localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
[ "${l2tp_enabled}" = 1 ] && {
|
||||
iptables -t nat -I POSTROUTING -s ${l2tp_localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j MASQUERADE 2>/dev/null
|
||||
iptables -I forwarding_rule -s ${l2tp_localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -I INPUT -p udp --dport 1701 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -t mangle -I OUTPUT -p udp --sport 1701 -m comment --comment "${ipt_flag}" -j RETURN 2>/dev/null
|
||||
}
|
||||
|
@ -69,16 +69,16 @@ gen_include() {
|
|||
}
|
||||
|
||||
start() {
|
||||
local vt_enabled=$(uci -q get $CONFIG.@service[0].enabled)
|
||||
local vt_enabled=$(uci -q get ${CONFIG}.@service[0].enabled)
|
||||
[ "$vt_enabled" = 0 ] && return 1
|
||||
|
||||
local vt_gateway="${vt_clientip%.*}.1"
|
||||
local vt_secret=$(uci -q get $CONFIG.@service[0].secret)
|
||||
local vt_secret=$(uci -q get ${CONFIG}.@service[0].secret)
|
||||
|
||||
local vt_l2tp_enabled=$(uci -q get $CONFIG.@service[0].l2tp_enable)
|
||||
[ "$vt_l2tp_enabled" = 1 ] && {
|
||||
touch $CHAP_SECRETS
|
||||
local vt_remoteip=$(uci -q get $CONFIG.@service[0].l2tp_remoteip)
|
||||
local l2tp_enabled=$(uci -q get ${CONFIG}.@service[0].l2tp_enable)
|
||||
[ "${l2tp_enabled}" = 1 ] && {
|
||||
touch ${CHAP_SECRETS}
|
||||
local vt_remoteip=$(uci -q get ${CONFIG}.@service[0].l2tp_remoteip)
|
||||
local ipsec_l2tp_config=$(cat <<-EOF
|
||||
#######################################
|
||||
# L2TP Connections
|
||||
|
@ -98,12 +98,12 @@ start() {
|
|||
EOF
|
||||
)
|
||||
|
||||
mkdir -p $L2TP_PATH
|
||||
cat > $L2TP_OPTIONS_FILE <<-EOF
|
||||
mkdir -p ${L2TP_PATH}
|
||||
cat > ${L2TP_OPTIONS_FILE} <<-EOF
|
||||
name "l2tp-server"
|
||||
ipcp-accept-local
|
||||
ipcp-accept-remote
|
||||
ms-dns ${vt_l2tp_localip}
|
||||
ms-dns ${l2tp_localip}
|
||||
noccp
|
||||
auth
|
||||
idle 1800
|
||||
|
@ -113,7 +113,7 @@ start() {
|
|||
lcp-echo-interval 60
|
||||
connect-delay 5000
|
||||
EOF
|
||||
cat > $L2TP_CONFIG_FILE <<-EOF
|
||||
cat > ${L2TP_CONFIG_FILE} <<-EOF
|
||||
[global]
|
||||
port = 1701
|
||||
;debug avp = yes
|
||||
|
@ -122,7 +122,7 @@ start() {
|
|||
;debug tunnel = yes
|
||||
[lns default]
|
||||
ip range = ${vt_remoteip}
|
||||
local ip = ${vt_l2tp_localip}
|
||||
local ip = ${l2tp_localip}
|
||||
require chap = yes
|
||||
refuse pap = yes
|
||||
require authentication = no
|
||||
|
@ -133,28 +133,33 @@ start() {
|
|||
EOF
|
||||
|
||||
local l2tp_users=$(get_enabled_anonymous_secs "@l2tp_users")
|
||||
[ -n "$l2tp_users" ] && {
|
||||
for user in $l2tp_users; do
|
||||
for i in $(uci -q show "${CONFIG}.${user}" | cut -d '.' -sf 3- | cut -d '=' -sf 1); do
|
||||
eval $i=\"$(uci -q get "${CONFIG}.${user}".$i)\"
|
||||
done
|
||||
[ "$enabled" -eq 1 ] || return 0
|
||||
[ -n "$username" ] || return 0
|
||||
[ -n "$password" ] || return 0
|
||||
[ -n "$ipaddress" ] || ipaddress="*"
|
||||
echo "$username l2tp-server $password $ipaddress" >> $CHAP_SECRETS
|
||||
[ -n "${l2tp_users}" ] && {
|
||||
for _user in ${l2tp_users}; do
|
||||
local u_enabled=$(uci -q get ${CONFIG}.${_user}.enabled)
|
||||
[ "${u_enabled}" -eq 1 ] || continue
|
||||
|
||||
local u_username=$(uci -q get ${CONFIG}.${_user}.username)
|
||||
[ -n "${u_username}" ] || continue
|
||||
|
||||
local u_password=$(uci -q get ${CONFIG}.${_user}.password)
|
||||
[ -n "${u_password}" ] || continue
|
||||
|
||||
local u_ipaddress=$(uci -q get ${CONFIG}.${_user}.ipaddress)
|
||||
[ -n "${u_ipaddress}" ] || u_ipaddress="*"
|
||||
|
||||
echo "${u_username} l2tp-server ${u_password} ${u_ipaddress}" >> ${CHAP_SECRETS}
|
||||
done
|
||||
}
|
||||
unset user
|
||||
|
||||
echo "ip-up-script /usr/share/xl2tpd/ip-up" >> $L2TP_OPTIONS_FILE
|
||||
echo "ip-down-script /usr/share/xl2tpd/ip-down" >> $L2TP_OPTIONS_FILE
|
||||
echo "ip-up-script /usr/share/xl2tpd/ip-up" >> ${L2TP_OPTIONS_FILE}
|
||||
echo "ip-down-script /usr/share/xl2tpd/ip-down" >> ${L2TP_OPTIONS_FILE}
|
||||
|
||||
xl2tpd -c $L2TP_CONFIG_FILE -C $L2TP_CONTROL_FILE -D >${L2TP_LOG_FILE} 2>&1 &
|
||||
xl2tpd -c ${L2TP_CONFIG_FILE} -C ${L2TP_CONTROL_FILE} -D >${L2TP_LOG_FILE} 2>&1 &
|
||||
rm -f "/usr/lib/ipsec/libipsec.so.0"
|
||||
}
|
||||
|
||||
cat > $IPSEC_CONN_FILE <<-EOF
|
||||
cat > ${IPSEC_CONN_FILE} <<-EOF
|
||||
# ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
|
@ -203,15 +208,18 @@ start() {
|
|||
EOF
|
||||
|
||||
local ipsec_users=$(get_enabled_anonymous_secs "@ipsec_users")
|
||||
[ -n "$ipsec_users" ] && {
|
||||
for user in $ipsec_users; do
|
||||
for i in $(uci -q show "${CONFIG}.${user}" | cut -d '.' -sf 3- | cut -d '=' -sf 1); do
|
||||
eval $i=\"$(uci -q get "${CONFIG}.${user}".$i)\"
|
||||
done
|
||||
[ "$enabled" -eq 1 ] || return 0
|
||||
[ -n "$username" ] || return 0
|
||||
[ -n "$password" ] || return 0
|
||||
echo "$username : XAUTH '$password'" >> $IPSEC_SECRETS_FILE
|
||||
[ -n "${ipsec_users}" ] && {
|
||||
for _user in ${ipsec_users}; do
|
||||
local u_enabled=$(uci -q get ${CONFIG}.${_user}.enabled)
|
||||
[ "${u_enabled}" -eq 1 ] || continue
|
||||
|
||||
local u_username=$(uci -q get ${CONFIG}.${_user}.username)
|
||||
[ -n "${u_username}" ] || continue
|
||||
|
||||
local u_password=$(uci -q get ${CONFIG}.${_user}.password)
|
||||
[ -n "${u_password}" ] || continue
|
||||
|
||||
echo "${u_username} : XAUTH '${u_password}'" >> ${IPSEC_SECRETS_FILE}
|
||||
done
|
||||
}
|
||||
unset user
|
||||
|
@ -230,9 +238,9 @@ start() {
|
|||
|
||||
stop() {
|
||||
ifdown ipsec_server > /dev/null 2>&1
|
||||
sed -i '/l2tp-server/d' $CHAP_SECRETS 2>/dev/null
|
||||
top -bn1 | grep "$L2TP_PATH" | grep -v "grep" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1
|
||||
rm -rf $L2TP_PATH
|
||||
sed -i '/l2tp-server/d' ${CHAP_SECRETS} 2>/dev/null
|
||||
top -bn1 | grep "${L2TP_PATH}" | grep -v "grep" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1
|
||||
rm -rf ${L2TP_PATH}
|
||||
ps -w | grep "/usr/lib/ipsec" | grep -v "grep" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1
|
||||
ipt_rule del
|
||||
rm -rf /var/etc/ipsecvpn.include
|
||||
|
|
|
@ -2333,6 +2333,8 @@ beacon.sina.com.cn
|
|||
beacon.taboola.com
|
||||
beacon1.turn.com
|
||||
beacon2.turn.com
|
||||
beam-ws.giraffe360.com
|
||||
beam.giraffe360.com
|
||||
beamincrease.com
|
||||
beap-bc.yahoo.com
|
||||
beap.adss.yahoo.com
|
||||
|
@ -3874,6 +3876,7 @@ everesttech.net
|
|||
evergage.com
|
||||
eversales.space
|
||||
evidon.com
|
||||
evs.sgmt.loom.com
|
||||
evyy.net
|
||||
ewg9465443.y4j32.cn
|
||||
ex.mobmore.com
|
||||
|
@ -6498,6 +6501,7 @@ pimproll.com
|
|||
pin.hpplay.cn
|
||||
ping.acc.sogou.com
|
||||
ping.chartbeat.net
|
||||
ping.hashnode.com
|
||||
ping.pinyin.sogou.com
|
||||
ping.ublock.org
|
||||
pingma.qq.com
|
||||
|
@ -7464,6 +7468,7 @@ securepubads.g.doubleclick.net
|
|||
sedoparking.com
|
||||
sedotracker.com
|
||||
seg.sharethis.com
|
||||
segment-cdn.producthunt.com
|
||||
selectivesummer.com
|
||||
semasio.net
|
||||
sendmepixel.com
|
||||
|
@ -8127,6 +8132,7 @@ t.supermario.xyz
|
|||
t.targetuse.com
|
||||
t.trafmag.com
|
||||
t.ujian.cc
|
||||
t.visitorqueue.com
|
||||
t.youmi.net
|
||||
t.yunsoka.com
|
||||
t1.58cdn.com.cn
|
||||
|
@ -8406,6 +8412,7 @@ track.madserving.com
|
|||
track.mailalert.io
|
||||
track.mailerlite.com
|
||||
track.mediav.com
|
||||
track.miro.com
|
||||
track.ra.icast.cn
|
||||
track.recreativ.ru
|
||||
track.segmetrics.io
|
||||
|
|
|
@ -63,7 +63,7 @@ o:depends("auto_update", true)
|
|||
|
||||
if has_v2ray or has_xray then
|
||||
o = s:option(Value, "v2ray_location_asset", translate("Location of V2ray/Xray asset"), translate("This variable specifies a directory where geoip.dat and geosite.dat files are."))
|
||||
o.default = "/usr/share/xray/"
|
||||
o.default = "/usr/share/v2ray/"
|
||||
o.rmempty = false
|
||||
|
||||
s = m:section(TypedSection, "shunt_rules", "V2ray/Xray " .. translate("Shunt Rule"), "<a style='color: red'>" .. translate("Please note attention to the priority, the higher the order, the higher the priority.") .. "</a>")
|
||||
|
|
|
@ -54,7 +54,7 @@ config global_rules
|
|||
list chnlist_url 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf'
|
||||
list chnlist_url 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf'
|
||||
list chnlist_url 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf'
|
||||
option v2ray_location_asset '/usr/share/xray/'
|
||||
option v2ray_location_asset '/usr/share/v2ray/'
|
||||
|
||||
config global_app
|
||||
option v2ray_file '/usr/bin/v2ray'
|
||||
|
|
|
@ -324,7 +324,7 @@ load_config() {
|
|||
|
||||
PROXY_IPV6=$(config_t_get global_forwarding ipv6_tproxy 0)
|
||||
|
||||
export V2RAY_LOCATION_ASSET=$(config_t_get global_rules v2ray_location_asset "/usr/share/xray/")
|
||||
export V2RAY_LOCATION_ASSET=$(config_t_get global_rules v2ray_location_asset "/usr/share/v2ray/")
|
||||
export XRAY_LOCATION_ASSET=$V2RAY_LOCATION_ASSET
|
||||
mkdir -p /tmp/etc $TMP_PATH $TMP_BIN_PATH $TMP_ID_PATH $TMP_PORT_PATH $TMP_ROUTE_PATH $TMP_ACL_PATH $TMP_PATH2
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ local chnroute6_url = ucic:get(name, "@global_rules[0]", "chnroute6_url") or {"
|
|||
local chnlist_url = ucic:get(name, "@global_rules[0]", "chnlist_url") or {"https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf","https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf","https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf"}
|
||||
local geoip_api = "https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest"
|
||||
local geosite_api = "https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest"
|
||||
local v2ray_asset_location = ucic:get_first(name, 'global_rules', "v2ray_location_asset", "/usr/share/xray/")
|
||||
local v2ray_asset_location = ucic:get_first(name, 'global_rules', "v2ray_location_asset", "/usr/share/v2ray/")
|
||||
|
||||
local log = function(...)
|
||||
if arg1 then
|
||||
|
|
|
@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk
|
|||
LUCI_TITLE:=LuCI support for PPTP VPN Server
|
||||
LUCI_DEPENDS:=+pptpd +kmod-mppe +ppp +luci-lib-jsonc
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=20211216
|
||||
PKG_RELEASE:=2
|
||||
PKG_VERSION:=20211223
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ PPTP_CONFIG_FILE=${PPTP_PATH}/pptpd.conf
|
|||
PPTP_OPTIONS_FILE=${PPTP_PATH}/options.pptpd
|
||||
CHAP_SECRETS=/etc/ppp/chap-secrets
|
||||
|
||||
vt_localip=$(uci -q get $CONFIG.@service[0].localip)
|
||||
[ -z "$vt_localip" ] && vt_localip="172.16.100.1"
|
||||
localip=$(uci -q get ${CONFIG}.@service[0].localip)
|
||||
[ -z "${localip}" ] && localip="172.16.100.1"
|
||||
|
||||
ipt_flag="PPTP VPN Server"
|
||||
|
||||
|
@ -18,8 +18,8 @@ get_enabled_anonymous_secs() {
|
|||
|
||||
ipt_rule() {
|
||||
if [ "$1" = "add" ]; then
|
||||
iptables -t nat -I POSTROUTING -s ${vt_localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j MASQUERADE 2>/dev/null
|
||||
iptables -I forwarding_rule -s ${vt_localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -t nat -I POSTROUTING -s ${localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j MASQUERADE 2>/dev/null
|
||||
iptables -I forwarding_rule -s ${localip%.*}.0/24 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -I INPUT -p tcp --dport 1723 -m comment --comment "${ipt_flag}" -j ACCEPT 2>/dev/null
|
||||
iptables -t mangle -I OUTPUT -p tcp --sport 1723 -m comment --comment "${ipt_flag}" -j RETURN 2>/dev/null
|
||||
else
|
||||
|
@ -37,14 +37,14 @@ ipt_rule() {
|
|||
}
|
||||
|
||||
gen_include() {
|
||||
echo '#!/bin/sh' > /var/etc/$CONFIG.include
|
||||
echo '#!/bin/sh' > /var/etc/${CONFIG}.include
|
||||
extract_rules() {
|
||||
echo "*$1"
|
||||
iptables-save -t $1 | grep "${ipt_flag}" | \
|
||||
sed -e "s/^-A \(INPUT\)/-I \1 1/"
|
||||
echo 'COMMIT'
|
||||
}
|
||||
cat <<-EOF >> /var/etc/$CONFIG.include
|
||||
cat <<-EOF >> /var/etc/${CONFIG}.include
|
||||
iptables-save -c | grep -v "${ipt_flag}" | iptables-restore -c
|
||||
iptables-restore -n <<-EOT
|
||||
$(extract_rules filter)
|
||||
|
@ -55,66 +55,71 @@ gen_include() {
|
|||
}
|
||||
|
||||
start() {
|
||||
local vt_enabled=$(uci -q get $CONFIG.@service[0].enabled)
|
||||
[ "$vt_enabled" -eq 1 ] || return 1
|
||||
touch $CHAP_SECRETS
|
||||
mkdir -p $PPTP_PATH
|
||||
local enabled=$(uci -q get ${CONFIG}.@service[0].enabled)
|
||||
[ "${enabled}" -eq 1 ] || return 1
|
||||
touch ${CHAP_SECRETS}
|
||||
mkdir -p ${PPTP_PATH}
|
||||
|
||||
cp /etc/ppp/options.pptpd $PPTP_OPTIONS_FILE
|
||||
sed -i '/mppe/d' $PPTP_OPTIONS_FILE 2>/dev/null
|
||||
sed -i '/ms-dns/d' $PPTP_OPTIONS_FILE 2>/dev/null
|
||||
sed -i '/name/d' $PPTP_OPTIONS_FILE 2>/dev/null
|
||||
echo "name pptp-server">> $PPTP_OPTIONS_FILE
|
||||
cp /etc/ppp/options.pptpd ${PPTP_OPTIONS_FILE}
|
||||
sed -i '/mppe/d' ${PPTP_OPTIONS_FILE} 2>/dev/null
|
||||
sed -i '/ms-dns/d' ${PPTP_OPTIONS_FILE} 2>/dev/null
|
||||
sed -i '/name/d' ${PPTP_OPTIONS_FILE} 2>/dev/null
|
||||
echo "name pptp-server">> ${PPTP_OPTIONS_FILE}
|
||||
|
||||
local vt_mppe=$(uci -q get $CONFIG.@service[0].mppe)
|
||||
[ -n "$vt_mppe" ] && [ "$vt_mppe" -eq 1 ] && echo "mppe required,no40,no56,stateless" >> $PPTP_OPTIONS_FILE
|
||||
local mppe=$(uci -q get ${CONFIG}.@service[0].mppe)
|
||||
[ -n "${mppe}" ] && [ "${mppe}" -eq 1 ] && echo "mppe required,no40,no56,stateless" >> ${PPTP_OPTIONS_FILE}
|
||||
|
||||
echo "ms-dns ${vt_localip}">> $PPTP_OPTIONS_FILE
|
||||
echo "ms-dns ${localip}">> ${PPTP_OPTIONS_FILE}
|
||||
|
||||
cp /etc/pptpd.conf $PPTP_CONFIG_FILE
|
||||
sed -i '/localip/d' $PPTP_CONFIG_FILE 2>/dev/null
|
||||
sed -i '/remoteip/d' $PPTP_CONFIG_FILE 2>/dev/null
|
||||
sed -i '/option/d' $PPTP_CONFIG_FILE 2>/dev/null
|
||||
sed -i '/name/d' $PPTP_CONFIG_FILE 2>/dev/null
|
||||
echo "name pptp-server">> $PPTP_CONFIG_FILE
|
||||
cp /etc/pptpd.conf ${PPTP_CONFIG_FILE}
|
||||
sed -i '/localip/d' ${PPTP_CONFIG_FILE} 2>/dev/null
|
||||
sed -i '/remoteip/d' ${PPTP_CONFIG_FILE} 2>/dev/null
|
||||
sed -i '/option/d' ${PPTP_CONFIG_FILE} 2>/dev/null
|
||||
sed -i '/name/d' ${PPTP_CONFIG_FILE} 2>/dev/null
|
||||
echo "name pptp-server">> ${PPTP_CONFIG_FILE}
|
||||
|
||||
local vt_remoteip=$(uci -q get $CONFIG.@service[0].remoteip)
|
||||
[ -z "$vt_remoteip" ] && vt_remoteip="172.16.100.10-20"
|
||||
local remoteip=$(uci -q get ${CONFIG}.@service[0].remoteip)
|
||||
[ -z "${remoteip}" ] && remoteip="172.16.100.10-20"
|
||||
|
||||
echo "localip ${vt_localip}" >> $PPTP_CONFIG_FILE
|
||||
echo "remoteip ${vt_remoteip}" >> $PPTP_CONFIG_FILE
|
||||
echo "option ${PPTP_OPTIONS_FILE}" >> $PPTP_CONFIG_FILE
|
||||
echo "localip ${localip}" >> ${PPTP_CONFIG_FILE}
|
||||
echo "remoteip ${remoteip}" >> ${PPTP_CONFIG_FILE}
|
||||
echo "option ${PPTP_OPTIONS_FILE}" >> ${PPTP_CONFIG_FILE}
|
||||
|
||||
local pptp_users=$(get_enabled_anonymous_secs "@users")
|
||||
[ -n "$pptp_users" ] && {
|
||||
for user in $pptp_users; do
|
||||
for i in $(uci -q show "${CONFIG}.${user}" | cut -d '.' -sf 3- | cut -d '=' -sf 1); do
|
||||
eval $i=\"$(uci -q get "${CONFIG}.${user}".$i)\"
|
||||
done
|
||||
[ "$enabled" -eq 1 ] || return 0
|
||||
[ -n "$username" ] || return 0
|
||||
[ -n "$password" ] || return 0
|
||||
[ -n "$ipaddress" ] || ipaddress="*"
|
||||
echo "$username pptp-server $password $ipaddress" >> $CHAP_SECRETS
|
||||
local _users=$(get_enabled_anonymous_secs "@users")
|
||||
[ -n "${_users}" ] && {
|
||||
for _user in ${_users}; do
|
||||
local u_enabled=$(uci -q get ${CONFIG}.${_user}.enabled)
|
||||
[ "${u_enabled}" -eq 1 ] || continue
|
||||
|
||||
local u_username=$(uci -q get ${CONFIG}.${_user}.username)
|
||||
[ -n "${u_username}" ] || continue
|
||||
|
||||
local u_password=$(uci -q get ${CONFIG}.${_user}.password)
|
||||
[ -n "${u_password}" ] || continue
|
||||
|
||||
local u_ipaddress=$(uci -q get ${CONFIG}.${_user}.ipaddress)
|
||||
[ -n "${u_ipaddress}" ] || u_ipaddress="*"
|
||||
|
||||
echo "${u_username} pptp-server ${u_password} ${u_ipaddress}" >> ${CHAP_SECRETS}
|
||||
done
|
||||
}
|
||||
|
||||
echo "ip-up-script /usr/share/pptpd/ip-up" >> $PPTP_OPTIONS_FILE
|
||||
echo "ip-down-script /usr/share/pptpd/ip-down" >> $PPTP_OPTIONS_FILE
|
||||
echo "ip-up-script /usr/share/pptpd/ip-up" >> ${PPTP_OPTIONS_FILE}
|
||||
echo "ip-down-script /usr/share/pptpd/ip-down" >> ${PPTP_OPTIONS_FILE}
|
||||
|
||||
for m in arc4 sha1_generic slhc crc-ccitt ppp_generic ppp_async ppp_mppe; do
|
||||
insmod $m >/dev/null 2>&1
|
||||
insmod ${m} >/dev/null 2>&1
|
||||
done
|
||||
/usr/sbin/pptpd -c $PPTP_CONFIG_FILE
|
||||
/usr/sbin/pptpd -c ${PPTP_CONFIG_FILE}
|
||||
|
||||
ipt_rule add
|
||||
gen_include
|
||||
}
|
||||
|
||||
stop() {
|
||||
sed -i '/pptp-server/d' $CHAP_SECRETS 2>/dev/null
|
||||
sed -i '/pptp-server/d' ${CHAP_SECRETS} 2>/dev/null
|
||||
top -bn1 | grep "${PPTP_PATH}" | grep -v "grep" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1
|
||||
ipt_rule del
|
||||
rm -rf /var/etc/$CONFIG.include
|
||||
rm -rf $PPTP_PATH
|
||||
rm -rf /var/etc/${CONFIG}.include
|
||||
rm -rf ${PPTP_PATH}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=shadowsocks-rust
|
||||
PKG_VERSION:=1.12.4
|
||||
PKG_VERSION:=1.12.5
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_HEADER:=shadowsocks-v$(PKG_VERSION)
|
||||
|
|
Loading…
Reference in New Issue