mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
Set multiple ports for ss-redir
This commit is contained in:
parent
41f2aea017
commit
b2d0e7c977
1 changed files with 13 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# Copyright (C) 2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter project
|
||||||
|
|
||||||
if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
|
if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
|
||||||
NBCPU=$(grep -c '^processor' /proc/cpuinfo | tr -d "\n")
|
NBCPU=$(grep -c '^processor' /proc/cpuinfo | tr -d "\n")
|
||||||
|
@ -49,6 +50,18 @@ if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
|
||||||
EOF
|
EOF
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
if [ "$(uci -q get shadowsocks-libev.hi3)" != "" ]; then
|
||||||
|
port=1101
|
||||||
|
for c in $(seq 3 2 $NBCPU); do
|
||||||
|
uci -q batch <<-EOF >/dev/null
|
||||||
|
set shadowsocks-libev.hi$c.local_port=$port
|
||||||
|
set shadowsocks-libev.hi$((c+1)).local_port=$port
|
||||||
|
commit shadowsocks-libev
|
||||||
|
EOF
|
||||||
|
port=$((port+1))
|
||||||
|
done
|
||||||
|
uci -q commit shadowsocks-libev
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$(uci -q get shadowsocks-libev.hi.obfs)" = "1" ]; then
|
if [ "$(uci -q get shadowsocks-libev.hi.obfs)" = "1" ]; then
|
||||||
uci -q batch <<-EOF > /dev/null
|
uci -q batch <<-EOF > /dev/null
|
||||||
|
|
Loading…
Reference in a new issue