1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 19:41:51 +00:00

Set multiple ports for ss-redir

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-02-07 17:03:30 +01:00
parent 41f2aea017
commit b2d0e7c977

View file

@ -1,4 +1,5 @@
#!/bin/sh
# Copyright (C) 2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter project
if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
NBCPU=$(grep -c '^processor' /proc/cpuinfo | tr -d "\n")
@ -49,6 +50,18 @@ if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
EOF
done
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
if [ "$(uci -q get shadowsocks-libev.hi.obfs)" = "1" ]; then
uci -q batch <<-EOF > /dev/null