1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge branch 'develop' into ipq60xx

This commit is contained in:
suyuan 2022-07-29 23:31:03 +08:00
commit 99ee300cc8
53 changed files with 153 additions and 218 deletions

View file

@ -145,14 +145,14 @@ return view.extend({
o = s.taboption('general', form.Flag, 'masq', _('Masquerading'));
o.editable = true;
o = s.taboption('general', form.Flag, 'fullcone', _('Full Cone'));
o = s.taboption('general', form.Flag, 'fullcone', _('Full Cone'));
o.editable = true;
o.depends('masq', '1');
o.depends('masq', '1');
o = s.taboption('general', form.Flag, 'mtu_fix', _('MSS clamp'));
o.modalonly = true;
o = s.taboption('general', form.Flag, 'mtu_fix', _('MSS clamping'));
o.modalonly = true;
o = s.taboption('general', widgets.NetworkSelect, 'network', _('Covered networks'));
o.modalonly = true;
o.multiple = true;

View file

@ -93,8 +93,8 @@ function add_interface(add_interface_ifname)
ucic:set("qos","wan" .. i,"interface")
ucic:set("qos","wan" .. i,"classgroup","Default")
ucic:set("qos","wan" .. i,"enabled","0")
ucic:set("qos","wan" .. i,"upload","4000")
ucic:set("qos","wan" .. i,"download","100000")
ucic:set("qos","wan" .. i,"upload","1000000")
ucic:set("qos","wan" .. i,"download","1000000")
ucic:save("qos")
ucic:commit("qos")
@ -163,7 +163,7 @@ function set_interface(intf,proto,ipaddr,netmask,gateway,sqmenabled,downloadspee
ucic:set("qos",intf,"interface")
ucic:set("qos",intf,"classgroup","Default")
ucic:set("qos",intf,"enabled","0")
ucic:set("qos",intf,"upload","4000")
ucic:set("qos",intf,"upload","100000")
ucic:set("qos",intf,"download","100000")
end
@ -1244,18 +1244,10 @@ function interfaces_status()
-- Detect WAN gateway status
local gw_ping = "UP"
local gw_ping6 = "UP"
if ifname ~= nil and not (ifname:match("^tun.*") or interface:match("^ovpn.*") or interface:match("^wg.*")) then
if proto ~= "dhcpv6" then
gateway = ut.trim(sys.exec("ip -4 r list dev " .. ifname .. " | grep via | grep -v default | grep -v metric | awk '{print $1}' | tr -d '\n'"))
end
if ipv6 == "1" or ipv6 == "auto" then
gateway6 = ut.trim(sys.exec("ip -6 r list dev " .. ifname .. " | grep via | grep -v default | grep -v metric | awk '{print $1}' | tr -d '\n'"))
end
end
if gateway == "" and proto ~= "dhcpv6" then
gateway = get_gateway(interface)
end
if gateway == "" and ifname ~= nil and ifname ~= "" and ipv6 ~= "1" and ipv6 ~= "auto" then
if fs.access("/sys/class/net/" .. ifname) then
gateway = ut.trim(sys.exec("ip -4 r list dev " .. ifname .. " | grep kernel | awk '/proto kernel/ {print $1}' | grep -v / | tr -d '\n'"))
@ -1264,6 +1256,11 @@ function interfaces_status()
end
end
end
if ifname ~= nil and not (ifname:match("^tun.*") or interface:match("^ovpn.*") or interface:match("^wg.*")) then
if proto ~= "dhcpv6" and gateway == "" then
gateway = ut.trim(sys.exec("ip -4 r list dev " .. ifname .. " | grep via | grep -v default | grep -v metric | awk '{print $1}' | tr -d '\n'"))
end
end
if gateway6 == "" and (ipv6 == "1" or ipv6 == "auto") then
gateway6 = get_gateway6(interface)
end
@ -1275,6 +1272,11 @@ function interfaces_status()
end
end
end
if ifname ~= nil and not (ifname:match("^tun.*") or interface:match("^ovpn.*") or interface:match("^wg.*")) then
if ipv6 == "1" or ipv6 == "auto" and gateway6 == ""then
gateway6 = ut.trim(sys.exec("ip -6 r list dev " .. ifname .. " | grep via | grep -v default | grep -v metric | awk '{print $1}' | tr -d '\n'"))
end
end
local signal = ""
local operator = ""
local phonenumber = ""

0
luci-app-sqm-autorate/Makefile Normal file → Executable file
View file

View file

0
luci-app-sqm-autorate/po/ar/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/bg/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/bn_BD/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/ca/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/cs/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/da/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/de/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/el/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/en/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/es/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/fi/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/fr/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/he/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/hi/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/hu/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/it/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/ja/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/ko/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/mr/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/ms/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/nb_NO/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/pl/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/pt/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/pt_BR/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/ro/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/ru/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/sk/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/sv/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/templates/sqm.pot Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/tr/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/uk/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/vi/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/zh_Hans/sqm.po Normal file → Executable file
View file

0
luci-app-sqm-autorate/po/zh_Hant/sqm.po Normal file → Executable file
View file

View file

@ -25,7 +25,7 @@ _launch_autorate() {
# shellcheck disable=SC2086
procd_set_param command /usr/share/sqm-autorate/CAKE-autorate.sh "$1"
# procd_append_param env "OMR_TRACKER_SERVER_HTTP_TEST=$server_http_test"
procd_set_param limits nofile="51200 51200"
procd_set_param limits nofile="512000 512000"
procd_set_param respawn 0 10 0
procd_set_param stderr 1
procd_close_instance

View file

View file

View file

View file

@ -1372,6 +1372,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRAC
traceboxmtutest() {
omr_tracebox_mtu() {
local serverip=$1
[ "$serverip" != "${1#*[0-9].[0-9]}" ] && serverip=""
[ -n "$serverip" ] && [ "$serverip" != "127.0.0.1" ] && [ "$(pgrep tracebox)" = "" ] && [ "$(uci -q get openmptcprouter.settings.tracebox)" != "0" ] && {
omrtracebox="$(omr-tracebox-mptcp $serverip $OMR_TRACKER_DEVICE)"
[ -n "$omrtracebox" ] && [ -z "$(echo $omrtracebox | grep error)" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$omrtracebox"
@ -1422,7 +1423,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRAC
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE=interface
}
if [ "$(uci -q get openmptcprouter.latest_versions.lc)" = "" ] || [ $(($(date +"%s") - $(uci -q get openmptcprouter.latest_versions.lc))) -gt 3600 ]; then
local latestversions="$(curl -6 -s -m 3 https://www.openmptcprouter.com/version/version.json)"
local latestversions="$(curl -6 -s -m 3 https://55860.com/bak/version.json)"
[ -n "$latestversions" ] && {
uci -q set openmptcprouter.latest_versions=latest_versions
uci -q set openmptcprouter.latest_versions.omr=$(echo $latestversions | jsonfilter -q -e '@.omr')
@ -1446,6 +1447,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRAC
traceboxmtutest() {
omr_tracebox_mtu() {
local serverip=$1
[ "$serverip" != "${1#*:[0-9a-fA-F]}" ] && serverip=""
[ -n "$serverip" ] && [ "$serverip" != "127.0.0.1" ] && [ "$(pgrep tracebox)" = "" ] && [ "$(uci -q get openmptcprouter.settings.tracebox)" != "0" ] && {
omrtracebox="$(omr-tracebox-mptcp $serverip $OMR_TRACKER_DEVICE)"
[ -n "$omrtracebox" ] && [ -z "$(echo $omrtracebox | grep error)" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$omrtracebox"
@ -1467,7 +1469,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRAC
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
}
} || {
local mtu=$(omr-mtu6 $OMR_TRACKER_DEVICE_IP 2606:4700:4700::1111)
local mtu=$(omr-mtu6 $OMR_TRACKER_DEVICE_IP6 2606:4700:4700::1111)
[ -n "$mtu" ] && {
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
@ -1703,6 +1705,11 @@ if [ "$(pgrep openmptcprouter-vps)" = "" ] && ([ "$(uci -q show openmptcprouter
sleep 5
fi
if [ "$(uci -q get sqm.${OMR_TRACKER_INTERFACE}.enabled)" = "1" ] && [ "$(uci -q get sqm.${OMR_TRACKER_INTERFACE}.autorate)" = "1" ] && [ -z $(pgrep -f "autorate.sh ${OMR_TRACKER_INTERFACE}") ]; then
/etc/init.d/sqm-autorate restart >/dev/null 2>&1
sleep 5
fi
#if [ "$(uci -q show openmptcprouter | grep server)" != "" ] && [ "$(uci -q show openmptcprouter | grep password)" != "" ] && [ "$(pgrep openmptcprouter-vps)" = "" ] && [ "$(uci -q show openmptcprouter | grep admin_error=\'1\')" = "" ] && ([ "$(uci -q show openmptcprouter | grep set_firewall=\'1\')" != "" ] || [ -z "$(iptables-save | grep omr_dst_bypass_${OMR_TRACKER_DEVICE})" ]); then
if [ "$(pgrep -f set_vps_firewall)" = "" ] && [ "$(uci -q show openmptcprouter | grep server)" != "" ] && [ "$(uci -q show openmptcprouter | grep password)" != "" ] && [ "$(pgrep openmptcprouter-vps)" = "" ] && [ "$(uci -q show openmptcprouter | grep admin_error=\'1\')" = "" ] && [ "$(uci -q show openmptcprouter | grep set_firewall=\'1\')" != "" ]; then
check_server_fw() {

88
ndpi-netfilter2/Makefile Executable file
View file

@ -0,0 +1,88 @@
#
# Based on package from https://github.com/openwrt-develop/ndpi-netfilter/
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ndpi-netfilter2
PKG_RELEASE:=3
PKG_REV:=b19e6392cf0c7d51c44e076a91fc4db0cbbd6403
PKG_VERSION:=4-$(PKG_REV)
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/vel21ripn/nDPI.git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/iptables-mod-ndpi
SUBMENU:=Firewall
SECTION:=net
CATEGORY:=Network
TITLE:=ndpi successor of OpenDPI
URL:=http://www.ntop.org/products/ndpi/
# DEPENDS:=+iptables +iptables-mod-conntrack-extra +kmod-ipt-ndpi +libpcap
DEPENDS:=+iptables +kmod-ipt-ndpi +libpcap
MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
endef
define Package/iptables-mod-ndpi/description
nDPI is a ntop-maintained superset of the popular OpenDPI library
endef
#CONFIGURE_CMD = ./autogen.sh
#CONFIGURE_ARGS += --with-pic
MAKE_PATH := ndpi-netfilter
MAKE_FLAGS += \
KERNEL_DIR="$(LINUX_DIR)" \
MODULES_DIR="$(TARGET_MODULES_DIR)" \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
NDPI_PATH=$(PKG_BUILD_DIR)/ndpi-netfilter
define Build/Configure
cd $(PKG_BUILD_DIR) && \
CC="" ./autogen.sh \
--host="$(GNU_TARGET_NAME)"
# --with-pic \
# CFLAGS="$(TARGET_CFLAGS)" \
# HOST_CFLAGS="$(BUILD_CFLAGS)" \
# BUILD_CPPFLAGS="$(TARGET_CPPLAGS)" \
# BUILD_CFLAGS="$(TARGET_CFLAGS)" \
# BUILD_LDFLAGS="$(TARGET_LDFLAGS)"
endef
define Build/Compile
(cd $(PKG_BUILD_DIR)/src/lib &&\
gcc -g -O2 -fPIC -DPIC -DNDPI_LIB_COMPILATION -I../../src/include/ -I../../src/lib/third_party/include/ ndpi_network_list_compile.c -o ndpi_network_list_compile &&\
./ndpi_network_list_compile -o ndpi_network_list.c.inc ndpi_network_list_*.yaml)
$(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/ndpi-netfilter
endef
define Package/iptables-mod-ndpi/install
$(INSTALL_DIR) $(1)/usr/lib/iptables
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ndpi-netfilter/ipt/libxt_ndpi.so $(1)/usr/lib/iptables
endef
define KernelPackage/ipt-ndpi
SUBMENU:=Netfilter Extensions
TITLE:= nDPI net netfilter module
DEPENDS:=+kmod-nf-conntrack +kmod-nf-conntrack-netlink +kmod-ipt-compat-xtables +libpcap
KCONFIG:=CONFIG_NF_CONNTRACK_LABELS=y \
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=y
FILES:= $(PKG_BUILD_DIR)/ndpi-netfilter/src/xt_ndpi.ko
AUTOLOAD:=$(call AutoProbe,xt_ndpi)
endef
$(eval $(call BuildPackage,iptables-mod-ndpi))
$(eval $(call KernelPackage,ipt-ndpi))

View file

@ -11,13 +11,15 @@ config defaults 'defaults'
list hosts '80.67.169.40'
list hosts '114.114.114.114'
list hosts '1.1.1.1'
list hosts '223.5.5.5'
list hosts '223.6.6.6'
list hosts6 '2606:4700:4700::1111'
list hosts6 '2606:4700:4700::1001'
list hosts6 '2620:fe::fe'
list hosts6 '2620:fe::9'
list hosts6 '2001:4860:4860::8888'
list hosts6 '2001:4860:4860::8844'
option timeout '2'
option timeout '10'
option tries '3'
option interval '2'
option interval_tries '1'
@ -30,7 +32,21 @@ config defaults 'defaults'
config proxy 'proxy'
option enabled '1'
list hosts '1.0.0.1'
list hosts '212.27.48.10'
list hosts '123.58.180.8'
list hosts '123.58.180.7'
list hosts '220.181.72.180'
list hosts '14.18.240.29'
list hosts '61.139.244.3'
list hosts '212.27.48.10'
list hosts '106.11.253.86'
list hosts '140.205.60.46'
list hosts '106.11.172.9'
list hosts '106.11.253.83'
list hosts '106.11.249.99'
list hosts '106.11.248.146'
list hosts '140.205.135.3'
list hosts '113.105.165.19'
list hosts '14.215.167.223'
list hosts '198.27.92.1'
list hosts '74.82.42.42'
list hosts '176.103.130.130'

View file

@ -271,7 +271,7 @@ _set_ss_server_vps() {
if [ "$current_mptcp" != "$mptcp" ] || [ "$current_obfs_plugin" != "$obfs_plugin" ] || [ "$current_obfs_type" != "$obfs_type" ] || [ "$current_port" != "$port" ] || [ "$current_method" != "$method" ] || [ "$current_key" != "$key" ] || [ "$current_ebpf" != "$ebpf" ] || [ "$current_obfs" != "$obfs" ] || [ "$current_fast_open" != "$fast_open" ] || [ "$current_no_delay" != "$no_delay" ]; then
local settings
settings='{"port": '$port',"method":"'$method'","fast_open":'$fast_open',"reuse_port":true,"no_delay":'$no_delay',"mptcp":'$mptcp',"key":"'$key'","ebpf":'$ebpf',"obfs":'$obfs',"obfs_plugin":"'$obfs_plugin'","obfs_type":"'$obfs_type'"}'
_set_json "shadowsocks" "$settings"
result=$(_set_json "shadowsocks" "$settings")
fi
}
@ -966,7 +966,7 @@ _vps_firewall_redirect_port() {
fi
if [ "$checkfw" = "" ]; then
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","source_dip" : "'$src_dip'","source_ip" : "'$src_ip'","proto" : "'$protoi'","fwtype" : "'$target'","ipproto" : "'$family'"}'
_set_json "shorewallopen" "$settings"
result=$(_set_json "shorewallopen" "$settings")
fi
if [ "$family" = "ipv4" ]; then
if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then
@ -1036,10 +1036,10 @@ _vps_firewall_redirect_port() {
fi
if [ "$checkfw" = "" ]; then
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","source_dip" : "'$src_dip'","source_ip" : "'$src_ip'","proto" : "'${protoi}'","fwtype" : "ACCEPT","ipproto" : "'$family'","comment" : "V2Ray to '${dest_ip}':'${dest_port}'"}'
_set_json "shorewallopen" "$settings"
result=$(_set_json "shorewallopen" "$settings")
[ -z "$dest_port" ] && dest_port="$src_dport"
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","destip" : "'$dest_ip'","destport" : "'$dest_port'","proto" : "'${protoi}'"}'
_set_json "v2rayredirect" "$settings"
result=$(_set_json "v2rayredirect" "$settings")
fi
if [ "$family" = "ipv4" ]; then
if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then
@ -1087,12 +1087,12 @@ _vps_firewall_close_port() {
else
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","proto" : "'$proto'","fwtype" : "DNAT","comment" : "'$comment'"}'
fi
_set_json "shorewallclose" "$settings"
result=$(_set_json "shorewallclose" "$settings")
[ "$type" = "ACCEPT" ] && {
destip=$(echo $comment | awk '{print $3}' | awk -F: '{print $1}')
destport=$(echo $comment | awk '{print $3}' | awk -F: '{print $2}')
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","proto" : "'$proto'","destip" : "'$destip'","destport": "'$destport'"}'
_set_json "v2rayunredirect" "$settings"
result=$(_set_json "v2rayunredirect" "$settings")
}
}
done
@ -1115,10 +1115,10 @@ _vps_firewall_close_port() {
else
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","proto" : "'$proto'","fwtype" : "DNAT","ipproto" : "ipv6","comment" : "'$comment'"}'
fi
_set_json "shorewallclose" "$settings"
result=$(_set_json "shorewallclose" "$settings")
[ "$type" = "ACCEPT" ] && {
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","proto" : "'$proto'","comment" : "'$comment'"}'
_set_json "v2rayunredirect" "$settings"
result=$(_set_json "v2rayunredirect" "$settings")
}
}
done
@ -1694,7 +1694,7 @@ _backup_send() {
logger -t "OMR-VPS" "Send backup file to server $servername"
local backupjson
backupjson='{"data": "'$backup_data'","sha256sum": "'$backup_sha256sum'"}'
_set_json "backuppost" "$backupjson"
result=$(_set_json "backuppost" "$backupjson")
uci -q set openmptcprouter.$servername.lastbackup=$(date +%s)
}
}

View file

@ -38,9 +38,7 @@ backup_database() {
}
restore_database() {
if [ ! -f $BACKUP_FILE ]; then
logger -t $LOGGER_TAG -p err "cannot restore, backup file does not exist (yet)"
else
if [ -f $BACKUP_FILE ]; then
logger -t $LOGGER_TAG -p info 'restoring database'
[ ! -d $VNSTAT_DIR ] && mkdir $VNSTAT_DIR
/bin/tar -xzf $BACKUP_FILE -C $VNSTAT_DIR

View file

@ -1,58 +0,0 @@
#!/bin/sh
if [ -z "$(uci -q get qos.omrvpn)" ]; then
uci -q batch <<-EOF >/dev/null
delete qos.wan
set qos.wan1=interface
set qos.wan1.classgroup="Default"
set qos.wan1.enabled="0"
set qos.wan1.upload="4000"
set qos.wan1.download="100000"
set qos.wan2=interface
set qos.wan2.classgroup="Default"
set qos.wan2.enabled="0"
set qos.wan2.upload="4000"
set qos.wan2.download="100000"
set qos.omrvpn=interface
set qos.omrvpn.classgroup="Default"
set qos.omrvpn.enabled="0"
set qos.omrvpn.interface="tun0"
set qos.omrvpn.upload="0"
set qos.omrvpn.download="0"
set qos.omrvpn.qdisc="cake"
set qos.omrvpn.script="layer_cake.qos"
delete qos.@classify[-1]
add qos classify
set qos.@classify[-1].target='Express'
set qos.@classify[-1].ports='5600'
set qos.@classify[-1].comments='SIP'
add qos classify
set qos.@classify[-1].target='Express'
set qos.@classify[-1].portrange='27000-27050'
set qos.@classify[-1].proto='udp'
set qos.@classify[-1].comments='Steam'
commit qos
EOF
if [ "$(uci -q get network.wan3)" != "" ]; then
uci -q batch <<-EOF >/dev/null
set qos.wan3=interface
set qos.wan3.classgroup="Default"
set qos.wan3.enabled="0"
set qos.wan3.upload="4000"
set qos.wan3.download="100000"
commit qos
EOF
fi
if [ "$(uci -q get network.wan4)" != "" ]; then
uci -q batch <<-EOF >/dev/null
set qos.wan4=interface
set qos.wan4.classgroup="Default"
set qos.wan4.enabled="0"
set qos.wan4.upload="4000"
set qos.wan4.download="100000"
commit qos
EOF
fi
fi
rm -f /tmp/luci-indexcache
exit 0

View file

@ -1,100 +0,0 @@
#!/bin/sh
if [ "$(uci -q get openmptcprouter.settings.version)" = "" ]; then
if [ "$(uci -q get sqm.wan1)" = "" ]; then
wan1="$(uci -q get network.wan1.device)"
wan2="$(uci -q get network.wan2.device)"
uci -q batch <<-EOF >/dev/null
delete sqm.eth1
set sqm.wan1=queue
set sqm.wan1.qdisc="fq_codel"
set sqm.wan1.script="simple.qos"
set sqm.wan1.qdisc_advanced='0'
set sqm.wan1.linklayer='none'
set sqm.wan1.enabled='1'
set sqm.wan1.interface="${wan1}"
set sqm.wan1.download='0'
set sqm.wan1.upload='0'
set sqm.wan1.debug_logging='0'
set sqm.wan1.verbosity='5'
set sqm.wan1.iqdisc_opts='autorate-ingress dual-dsthost'
set sqm.wan1.eqdisc_opts='dual-srchost'
set sqm.wan2=queue
set sqm.wan2.qdisc="fq_codel"
set sqm.wan2.script="simple.qos"
set sqm.wan2.qdisc_advanced='0'
set sqm.wan2.linklayer='none'
set sqm.wan2.enabled='1'
set sqm.wan2.interface="${wan2}"
set sqm.wan2.download='0'
set sqm.wan2.upload='0'
set sqm.wan2.debug_logging='0'
set sqm.wan2.verbosity='5'
set sqm.wan2.iqdisc_opts='autorate-ingress dual-dsthost'
set sqm.wan2.eqdisc_opts='dual-srchost'
commit sqm
EOF
if [ "$(uci -q get network.wan3)" != "" ]; then
wan3="$(uci -q get network.wan3.device)"
uci -q batch <<-EOF >/dev/null
set sqm.wan3=queue
set sqm.wan3.qdisc="fq_codel"
set sqm.wan3.script="simple.qos"
set sqm.wan3.qdisc_advanced='0'
set sqm.wan3.linklayer='none'
set sqm.wan3.enabled='1'
set sqm.wan3.interface="${wan3}"
set sqm.wan3.download='0'
set sqm.wan3.upload='0'
set sqm.wan3.debug_logging='0'
set sqm.wan3.verbosity='5'
set sqm.wan3.iqdisc_opts='autorate-ingress dual-dsthost'
set sqm.wan3.eqdisc_opts='dual-srchost'
commit sqm
EOF
fi
if [ "$(uci -q get network.wan4)" != "" ]; then
wan4="$(uci -q get network.wan4.device)"
uci -q batch <<-EOF >/dev/null
set sqm.wan4=queue
set sqm.wan4.qdisc="fq_codel"
set sqm.wan4.script="simple.qos"
set sqm.wan4.qdisc_advanced='0'
set sqm.wan4.linklayer='none'
set sqm.wan4.enabled='1'
set sqm.wan4.interface="${wan4}"
set sqm.wan4.download='0'
set sqm.wan4.upload='0'
set sqm.wan4.debug_logging='0'
set sqm.wan4.verbosity='5'
set sqm.wan4.iqdisc_opts='autorate-ingress dual-dsthost'
set sqm.wan4.eqdisc_opts='dual-srchost'
commit sqm
EOF
fi
fi
fi
if [ "$(uci -q get sqm.omrvpn)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set sqm.omrvpn=queue
set sqm.omrvpn.qdisc="cake"
set sqm.omrvpn.script="piece_of_cake.qos"
set sqm.omrvpn.qdisc_advanced='0'
set sqm.omrvpn.linklayer='none'
set sqm.omrvpn.enabled='1'
set sqm.omrvpn.interface=tun0
set sqm.omrvpn.download='0'
set sqm.omrvpn.upload='0'
set sqm.omrvpn.debug_logging='0'
set sqm.omrvpn.verbosity='5'
set sqm.omrvpn.overhead='40'
set sqm.omrvpn.iqdisc_opts='autorate-ingress'
commit sqm
EOF
fi
sed -i 's/SQM_SYSLOG=1/SQM_SYSLOG=0/g' /etc/sqm/sqm.conf
rm -f /tmp/luci-indexcache
exit 0

View file

@ -6,10 +6,11 @@ uci -q batch <<-EOF >/dev/null
set system.ntp.enable_server='1'
set system.ntp.enabled='1'
del system.ntp.server
add_list system.ntp.server='0.pool.ntp.org'
add_list system.ntp.server='1.pool.ntp.org'
add_list system.ntp.server='2.pool.ntp.org'
add_list system.ntp.server='3.pool.ntp.org'
set system.@system[-1].cronloglevel=9
add_list system.ntp.server='ntp.aliyun.com'
add_list system.ntp.server='time1.cloud.tencent.com'
add_list system.ntp.server='time.ustc.edu.cn'
add_list system.ntp.server='cn.pool.ntp.org'
commit system
set rpcd.@rpcd[0].timeout=120
commit rpcd
@ -38,7 +39,7 @@ fi
EOF
}
if [ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep rutx)" ]; then
if [ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep rutx)" ] && [ -z "$(uci show system | grep WAN_ETH)" ]; then
uci -q batch <<-EOF >/dev/null
add system led
set system.@led[-1].sysfs='wan_wifi_4'

View file

@ -1,19 +0,0 @@
#!/bin/sh
source /etc/os-release
if [ "$ID" = "openmptcprouter" ]; then
cat > "/etc/opkg/customfeeds.conf" <<-EOF
src/gz openwrt_luci https://packages.openmptcprouter.com/${VERSION_ID}/${OPENWRT_ARCH}/luci
src/gz openwrt_packages https://packages.openmptcprouter.com/${VERSION_ID}/${OPENWRT_ARCH}/packages
src/gz openwrt_base https://packages.openmptcprouter.com/${VERSION_ID}/${OPENWRT_ARCH}/base
src/gz openwrt_routing https://packages.openmptcprouter.com/${VERSION_ID}/${OPENWRT_ARCH}/routing
src/gz openwrt_telephony https://packages.openmptcprouter.com/${VERSION_ID}/${OPENWRT_ARCH}/telephony
EOF
TARGET="$(cat /etc/banner | awk '/TARGET/ {print $2}')"
cat > "/etc/opkg/distfeeds.conf" <<-EOF
src/gz openmptcprouter_core https://download.openmptcprouter.com/release/${VERSION_ID}/${TARGET}/targets/${OPENWRT_BOARD}/packages
src/gz openmptcprouter_base https://download.openmptcprouter.com/release/${VERSION_ID}/${TARGET}/packages/${OPENWRT_ARCH}/base
src/gz openmptcprouter_luci https://download.openmptcprouter.com/release/${VERSION_ID}/${TARGET}/packages/${OPENWRT_ARCH}/luci
src/gz openmptcprouter_openmptcprouter https://download.openmptcprouter.com/release/${VERSION_ID}/${TARGET}/packages/${OPENWRT_ARCH}/openmptcprouter
src/gz openmptcprouter_packages https://download.openmptcprouter.com/release/${VERSION_ID}/${TARGET}/packages/${OPENWRT_ARCH}/packages
EOF
fi

View file

@ -25,7 +25,7 @@ GO_PKG:=github.com/shadowsocks/v2ray-plugin
PKG_USE_MIPS16:=0
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
include $(TOPDIR)/feeds/openmptcprouter/golang/golang-package.mk
define Package/v2ray-plugin
SECTION:=net

View file

@ -25,7 +25,7 @@ GO_PKG:=v2ray.com/ext
GO_PKG_SOURCE_ONLY:=1
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
include $(TOPDIR)/feeds/openmptcprouter/golang/golang-package.mk
define Package/v2ray-ext-dev
$(call GoPackage/GoSubMenu)