Skip to content

Commit 954b5f9

Browse files
committed
passwall : fix maybe not subscribe problem
1 parent 58939d8 commit 954b5f9

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

lienol/luci-app-passwall/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ define Package/$(PKG_NAME)
8181
SUBMENU:=3. Applications
8282
TITLE:=LuCI support for PassWall By Lienol
8383
PKGARCH:=all
84-
DEPENDS:=+curl +libcurl +libmbedtls +ca-bundle +ca-certificates +resolveip +iptables-mod-tproxy +kmod-ipt-tproxy +iptables-mod-ipopt +kmod-ipt-ipopt +ip +ipset +coreutils +coreutils-base64 +coreutils-nohup +luci-lib-jsonc +unzip \
84+
DEPENDS:=+curl +wget +libcurl +libmbedtls +ca-bundle +ca-certificates +resolveip +iptables-mod-tproxy +kmod-ipt-tproxy +iptables-mod-ipopt +kmod-ipt-ipopt +ip +ipset +coreutils +coreutils-base64 +coreutils-nohup +luci-lib-jsonc +unzip \
8585
+dnsmasq-full +tcping \
8686
+PACKAGE_$(PKG_NAME)_INCLUDE_redsocks2:redsocks2 \
8787
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \

lienol/luci-app-passwall/root/usr/share/passwall/rule_update.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ uci_get_by_type() {
3333

3434
# rule update
3535
echo $Date: 开始更新规则,请等待... >$LOG_FILE
36-
#wget -q --no-check-certificate --timeout=15 https://raw.githubusercontent.com/monokoo/koolshare.github.io/acelan_softcenter_ui/maintain_files/version1 -O /tmp/version1
37-
status1=$(curl -w %{http_code} --connect-timeout 10 $url_main/version1 --silent -o /tmp/version1)
38-
if [ -z "$status1" ] || [ "$status1" == "404" ]; then
36+
#/usr/bin/wget -q --no-check-certificate --timeout=15 https://raw.githubusercontent.com/monokoo/koolshare.github.io/acelan_softcenter_ui/maintain_files/version1 -O /tmp/version1
37+
status1=$(/usr/bin/curl -w %{http_code} --connect-timeout 10 $url_main/version1 --silent -o /tmp/version1)
38+
if [ "$?" != 0 ] || [ ! -f "/tmp/version1" ] || [ -z "$status1" ] || [ "$status1" != "200" ]; then
3939
echo $Date: 无法访问更新接口,请更新接口! >>$LOG_FILE
4040
exit
4141
fi
4242
online_content=$(cat /tmp/version1 2>/dev/null)
4343
if [ -z "$online_content" ]; then
4444
rm -rf /tmp/version1
45-
echo $Date: 没有检测到在线版本,可能是访问github有问题,去大陆白名单模式试试吧>>$LOG_FILE
45+
echo $Date: 没有检测到在线版本,可能是访问github有问题! >>$LOG_FILE
4646
exit
4747
fi
4848

@@ -57,9 +57,9 @@ if [ "$gfwlist_update" == 1 ]; then
5757
if [ "$version_gfwlist1" != "$version_gfwlist2" -o "$md5sum_gfwlist2" != "$local_md5sum_gfwlist" ]; then
5858
echo $Date: 检测到新版本gfwlist,开始更新... >>$LOG_FILE
5959
echo $Date: 下载gfwlist到临时文件... >>$LOG_FILE
60-
#wget --no-check-certificate --timeout=15 -q https://raw.githubusercontent.com/monokoo/koolshare.github.io/acelan_softcenter_ui/maintain_files/gfwlist.conf -O /tmp/gfwlist.conf
61-
status2=$(curl -w %{http_code} --connect-timeout 10 $url_main/gfwlist.conf --silent -o /tmp/gfwlist.conf)
62-
if [ -z "$status2" ] || [ "$status2" == "404" ]; then
60+
#/usr/bin/wget --no-check-certificate --timeout=15 -q https://raw.githubusercontent.com/monokoo/koolshare.github.io/acelan_softcenter_ui/maintain_files/gfwlist.conf -O /tmp/gfwlist.conf
61+
status2=$(/usr/bin/curl -w %{http_code} --connect-timeout 10 $url_main/gfwlist.conf --silent -o /tmp/gfwlist.conf)
62+
if [ "$?" != 0 ] || [ ! -f "/tmp/gfwlist.conf" ] || [ -z "$status2" ] || [ "$status2" != "200" ]; then
6363
echo $Date: 无法访问更新接口,请更新接口! >>$LOG_FILE
6464
exit
6565
fi
@@ -94,9 +94,9 @@ if [ "$chnroute_update" == 1 ]; then
9494
if [ "$version_chnroute1" != "$version_chnroute2" -o "$md5sum_chnroute2" != "$local_md5sum_chnroute" ]; then
9595
echo $Date: 检测到新版本chnroute,开始更新... >>$LOG_FILE
9696
echo $Date: 下载chnroute到临时文件... >>$LOG_FILE
97-
#wget --no-check-certificate --timeout=15 -q https://raw.githubusercontent.com/monokoo/koolshare.github.io/acelan_softcenter_ui/maintain_files/chnroute.txt -O /tmp/chnroute
98-
status3=$(curl -w %{http_code} --connect-timeout 10 $url_main/chnroute.txt --silent -o /tmp/chnroute)
99-
if [ -z "$status3" ] || [ "$status3" == "404" ]; then
97+
#/usr/bin/wget --no-check-certificate --timeout=15 -q https://raw.githubusercontent.com/monokoo/koolshare.github.io/acelan_softcenter_ui/maintain_files/chnroute.txt -O /tmp/chnroute
98+
status3=$(/usr/bin/curl -w %{http_code} --connect-timeout 10 $url_main/chnroute.txt --silent -o /tmp/chnroute)
99+
if [ "$?" != 0 ] || [ ! -f "/tmp/chnroute" ] || [ -z "$status3" ] || [ "$status3" == "404" ]; then
100100
echo $Date: 无法访问更新接口,请更新接口! >>$LOG_FILE
101101
exit
102102
fi

lienol/luci-app-passwall/root/usr/share/passwall/subscription.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,18 @@ start() {
326326
for url in $subscribe_url
327327
do
328328
let index+=1
329-
#/usr/bin/wget --no-check-certificate --timeout=8 -t 2 $url -P /var/${CONFIG}_sub
330-
status=$(curl -w %{http_code} --connect-timeout 10 $url --silent -o /var/${CONFIG}_sub/$index)
331-
[ -z "$status" ] || [ "$status" != "200" ] && echo "$Date: 订阅链接$url下载失败,请重试!" >> $LOG_FILE && continue
329+
echo "$Date: 正在订阅:$url" >> $LOG_FILE
330+
#status=$(/usr/bin/curl -w %{http_code} --connect-timeout 10 $url --silent -o /var/${CONFIG}_sub/$index)
331+
result=$(/usr/bin/wget --no-check-certificate --timeout=8 -t 1 -O- $url)
332+
[ "$?" != 0 ] || [ -z "$result" ] && echo "$Date: 订阅失败:$url,请检测订阅链接是否正常或使用代理尝试!" >> $LOG_FILE && continue
333+
echo "$result" > /var/${CONFIG}_sub/$index
332334
done
333335
[ ! -d "/var/${CONFIG}_sub" ] || [ "$(ls /var/${CONFIG}_sub | wc -l)" -eq 0 ] && echo "$Date: 订阅失败" >> $LOG_FILE && rm -f "$LOCK_FILE" && exit 0
334336
mkdir -p /usr/share/${CONFIG}/sub && rm -f /usr/share/${CONFIG}/sub/*
335337
get_local_nodes
336338
for file in /var/${CONFIG}_sub/*
337339
do
338-
[ -z "$(du -sh $file 2> /dev/null)" ] && echo "$Date: 订阅链接下载 $file 失败,请重试" >> $LOG_FILE && continue
340+
[ -z "$(du -sh $file 2> /dev/null)" ] && echo "$Date: 订阅失败:$url,解密失败" >> $LOG_FILE && continue
339341
decode_link=$(cat "$file" | /usr/bin/base64 -d 2> /dev/null)
340342
maxnum=$(echo -n "$decode_link" | grep "MAX=" | awk -F"=" '{print $2}')
341343
if [ -n "$maxnum" ]; then

lienol/luci-app-passwall/root/usr/share/passwall/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ get_date() {
88
}
99

1010
test_url() {
11-
status=$(curl -I -o /dev/null -s --connect-timeout 5 -w %{http_code} "$1" | grep 200)
11+
status=$(/usr/bin/curl -I -o /dev/null -s --connect-timeout 5 -w %{http_code} "$1" | grep 200)
1212
echo $status
1313
}
1414

0 commit comments

Comments
 (0)