Skip to content

Commit

Permalink
sync (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
suyuan168 authored Sep 2, 2024
2 parents 0c79279 + bdee3d1 commit e661944
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,8 @@ function wizard_add()
ucic:set("shadowsocks-rust","sss0","disabled","1")
ucic:set("shadowsocks-rust","sss1","disabled","1")
end
ucic:set("shadowsocks-rust","sss0","key","")
ucic:set("shadowsocks-rust","sss1","key","")
ucic:set("shadowsocks-rust","sss0","password","")
ucic:set("shadowsocks-rust","sss1","password","")
ucic:set("xray","omrout","s_shadowsocks_password","")
ucic:save("shadowsocks-rust")
ucic:commit("shadowsocks-rust")
Expand Down
2 changes: 1 addition & 1 deletion luci-app-openmptcprouter/root/bin/anonymous_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ uci show | \
-e "/shadowsocks-libev\.sss.*\.server=/s/......$/xxxxxx'/" \
-e "/shadowsocks-libev\.sss.*\.key=/s/......$/xxxxxx'/" \
-e "/shadowsocks-rust\.sss.*\.server=/s/......$/xxxxxx'/" \
-e "/shadowsocks-rust\.sss.*\.key=/s/......$/xxxxxx'/" \
-e "/shadowsocks-rust\.sss.*\.password=/s/......$/xxxxxx'/" \
-e "/external_ip=/s/......$/xxxxxx'/" \
-e "/obfs_host=/s/..........$/xxxxxx'/" \
-e "/vmess_address=/s/......$/xxxxxx'/" \
Expand Down
4 changes: 2 additions & 2 deletions omr-schedule/files/usr/share/omr/schedule.d/010-services
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ -f /etc/init.d/shadowsocks-libev ] && [ "$(pgrep -f omr-tracker-ss)" = "" ]
/etc/init.d/shadowsocks-libev restart >/dev/null 2>&1
sleep 5
fi
if [ -f /etc/init.d/shadowsocks-rust ] && [ "$(pgrep -f omr-tracker-ss)" = "" ] && [ "$(pgrep -f sslocal)" = "" ] && [ "$(pgrep -f sslocal)" = "" ] && [ "$(uci -q get shadowsocks-rust.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "192.18.1.3" ] && [ "$(uci -q get shadowsocks-rust.sss0.key)" != "" ]; then
if [ -f /etc/init.d/shadowsocks-rust ] && [ "$(pgrep -f omr-tracker-ss)" = "" ] && [ "$(pgrep -f sslocal)" = "" ] && [ "$(pgrep -f sslocal)" = "" ] && [ "$(uci -q get shadowsocks-rust.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "192.18.1.3" ] && [ "$(uci -q get shadowsocks-rust.sss0.password)" != "" ]; then
_log "Can't find Shadowsocks Rust, restart it..."
/etc/init.d/shadowsocks-rust restart >/dev/null 2>&1
sleep 5
Expand Down Expand Up @@ -195,7 +195,7 @@ if [ -f /etc/init.d/shadowsocks-libev ] && [ "$(uci -q get shadowsocks-libev.sss
/etc/init.d/omr-tracker restart >/dev/null 2>&1
fi

if [ -f /etc/init.d/shadowsocks-rust ] && [ "$(uci -q get shadowsocks-rust.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-rust.sss0.key)" != "" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-libev.rust.server)" != "192.168.1.3" ] && [ "$(pgrep -f omr-tracker-ss)" = "" ] && [ "$(pgrep -f '/etc/init.d/omr-tracker')" = "" ]; then
if [ -f /etc/init.d/shadowsocks-rust ] && [ "$(uci -q get shadowsocks-rust.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-rust.sss0.password)" != "" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-libev.rust.server)" != "192.168.1.3" ] && [ "$(pgrep -f omr-tracker-ss)" = "" ] && [ "$(pgrep -f '/etc/init.d/omr-tracker')" = "" ]; then
_log "Can't find omr-tracker-ss for Shadowsocks Rust, restart omr-tracker..."
/etc/init.d/omr-tracker restart >/dev/null 2>&1
fi
Expand Down
11 changes: 7 additions & 4 deletions omr-tracker/files/bin/omr-tracker-server
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ _ping_server() {
-c 1 \
-q \
"${host}" 2>&1
) && echo "$ret" | grep -sq " 0% packet loss" && {
)
loss=$(echo "$ret" | awk '/packet loss/ {gsub("%","");print $6}' | tr -d '\n')
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
server_ping=true
}
fi
}

_ping_server_intf() {
Expand All @@ -49,9 +51,10 @@ _ping_server_intf() {
-I "$intf" \
"${host}" 2>&1
)
[ -n "$ret" ] && echo "$ret" | grep -sq " 0% packet loss" && {
loss=$(echo "$ret" | awk '/packet loss/ {gsub("%","");print $6}' | tr -d '\n')
if [ -n "$loss" ] && [ "$loss" != "100" ]; then
server_ping=true
}
fi
k=$((k+1))
sleep "${intervaltries}"
done
Expand Down
4 changes: 2 additions & 2 deletions omr-tracker/files/bin/omr-tracker-ss
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ while true; do
/etc/init.d/shadowsocks-libev restart >/dev/null 2>&1
fi
_get_ip
elif [ "$type" = "rust" ] && [ "$(uci -q get shadowsocks-rust.ss_rules.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-rust.${server}.key)" != "" ] && [ "$(uci -q get shadowsocks-rust.${server}.server)" != "" ] && [ "$(uci -q get shadowsocks-rust.${server}.disabled)" != "1" ]; then
elif [ "$type" = "rust" ] && [ "$(uci -q get shadowsocks-rust.ss_rules.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-rust.${server}.password)" != "" ] && [ "$(uci -q get shadowsocks-rust.${server}.server)" != "" ] && [ "$(uci -q get shadowsocks-rust.${server}.disabled)" != "1" ]; then
_log "Reload Shadowsocks Rust rules"
/etc/init.d/shadowsocks-rust rules_up 2> /dev/null
if ! /etc/init.d/shadowsocks-rust rules_exist ; then
Expand Down Expand Up @@ -193,7 +193,7 @@ while true; do
/etc/init.d/shadowsocks-libev restart
sleep 5
fi
if [ "$type" = "rust" ] && [ "$(pgrep sslocal)" = "" ] && [ "$(uci -q get shadowsocks-rust.${server}.key)" != "" ]; then
if [ "$type" = "rust" ] && [ "$(pgrep sslocal)" = "" ] && [ "$(uci -q get shadowsocks-rust.${server}.password)" != "" ]; then
_log "Can't find shadowsocks rust, restart it..."
/etc/init.d/shadowsocks-rust restart
sleep 5
Expand Down

0 comments on commit e661944

Please sign in to comment.