优化代码

This commit is contained in:
Hyy2001X 2022-08-22 17:19:36 +08:00
parent 51fa1afea3
commit 0b666a4c74
3 changed files with 30 additions and 3 deletions

View File

@ -0,0 +1,23 @@
diff --git a/package/other/helloworld/luci-app-ssr-plus/root/usr/bin/ssr-rules b/luci-app-ssr-plus/root/usr/bin/ssr-rules
index 4a85173..f1ead5e 100755
--- a/package/other/helloworld/luci-app-ssr-plus/root/usr/bin/ssr-rules
+++ b/package/other/helloworld/luci-app-ssr-plus/root/usr/bin/ssr-rules
@@ -51,7 +51,8 @@ usage() {
loger() {
# 1.alert 2.crit 3.err 4.warn 5.notice 6.info 7.debug
- logger -st ssr-rules[$$] -p$1 $2
+ logger -st "ssr-rules[$$]" -p"$1" "$2"
+ echo "$(date "+%Y-%m-%d %H:%M:%S"): ssr-rules[$$] $2" >> /var/log/ssrplus.log
}
flush_r() {
@@ -161,7 +162,7 @@ fw_rule() {
$IPT -A SS_SPEC_WAN_FW -d 224.0.0.0/4 -j RETURN
$IPT -A SS_SPEC_WAN_FW -d 240.0.0.0/4 -j RETURN
$IPT -A SS_SPEC_WAN_FW -p tcp $PROXY_PORTS -j REDIRECT --to-ports $local_port 2>/dev/null || {
- loger 3 "Can't redirect, please check the iptables."
+ loger 3 "Can't redirect $PROXY_PORTS to $local_port, please check the iptables."
exit 1
}
return $?

View File

@ -80,9 +80,13 @@ EOF
AddPackage git other OpenClash vernesong master
AddPackage git other luci-app-ikoolproxy iwrt main
AddPackage git other helloworld fw876 master
sed -i 's/143/143,8080,8443,6969,1337,6672/' $(PKG_Finder d package luci-app-ssr-plus)/root/etc/init.d/shadowsocksr
patch < ${CustomFiles}/Patches/fix_shadowsocksr_alterId.patch -p1 -d ${WORK}
sed -i 's/143/143,8080,8443,6969,1337/' $(PKG_Finder d package luci-app-ssr-plus)/root/etc/init.d/shadowsocksr
for x in $(ls -1 ${CustomFiles}/Patches/luci-app-shadowsocksr)
do
patch < ${CustomFiles}/Patches/luci-app-shadowsocksr/${x} -p1 -d ${WORK}
done
patch < ${CustomFiles}/Patches/fix_ntfs3_conflict_with_antfs.patch -p1 -d ${WORK}
patch < ${CustomFiles}/Patches/fix_aria2_auto_create_download_path.patch -p1 -d ${WORK}