mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 19:11:51 +00:00
59 lines
1.7 KiB
Bash
Executable file
59 lines
1.7 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
|
|
NBCPU=$(grep -c '^processor' /proc/cpuinfo | tr -d "\n")
|
|
if [ "$NBCPU" -gt 2 ]; then
|
|
if [ "$(uci -q get shadowsocks-libev.hi3)" = "" ]; then
|
|
for c in $(seq 3 $NBCPU); do
|
|
uci -q batch <<-EOF >/dev/null
|
|
set shadowsocks-libev.hi$c=ss_redir
|
|
set shadowsocks-libev.hi$c.server=sss0
|
|
set shadowsocks-libev.hi$c.local_address="0.0.0.0"
|
|
set shadowsocks-libev.hi$c.local_port=1100
|
|
set shadowsocks-libev.hi$c.mode=tcp_and_udp
|
|
set shadowsocks-libev.hi$c.timeout=600
|
|
set shadowsocks-libev.hi$c.fast_open=1
|
|
set shadowsocks-libev.hi$c.reuse_port=1
|
|
set shadowsocks-libev.hi$c.syslog=1
|
|
set shadowsocks-libev.hi$c.mptcp=1
|
|
set shadowsocks-libev.hi$c.no_delay=1
|
|
set shadowsocks-libev.hi$c.verbose=0
|
|
commit shadowsocks-libev
|
|
EOF
|
|
done
|
|
fi
|
|
fi
|
|
|
|
if [ "$(uci -q get shadowsocks-libev.hi.timeout)" != "600" ]; then
|
|
uci -q batch <<-EOF > /dev/null
|
|
set shadowsocks-libev.hi.timeout=600
|
|
commit shadowsocks-libev
|
|
EOF
|
|
for c in $(seq 2 $NBCPU); do
|
|
uci -q batch <<-EOF > /dev/null
|
|
set shadowsocks-libev.hi$c.timeout=600
|
|
commit shadowsocks-libev
|
|
EOF
|
|
done
|
|
fi
|
|
if [ "$(uci -q get shadowsocks-libev.sss0.method)" != "chacha20" ]; then
|
|
uci -q batch <<-EOF > /dev/null
|
|
set shadowsocks-libev.sss0.method=chacha20
|
|
commit shadowsocks-libev
|
|
EOF
|
|
fi
|
|
if [ "$(uci -q get shadowsocks-libev.hi.mode)" != "tcp" ]; then
|
|
uci -q batch <<-EOF > /dev/null
|
|
set shadowsocks-libev.hi.mode=tcp_and_udp
|
|
commit shadowsocks-libev
|
|
EOF
|
|
for c in $(seq 2 $NBCPU); do
|
|
uci -q batch <<-EOF > /dev/null
|
|
set shadowsocks-libev.hi$c.mode=tcp_and_udp
|
|
commit shadowsocks-libev
|
|
EOF
|
|
done
|
|
fi
|
|
fi
|
|
rm -f /tmp/luci-indexcache
|
|
exit 0
|