mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
sync (#514)
This commit is contained in:
commit
d138a66e5a
2 changed files with 37 additions and 29 deletions
|
@ -21,7 +21,7 @@ config_get lan_device lan ifname
|
||||||
_add_dscp_domain() {
|
_add_dscp_domain() {
|
||||||
domain=""; config_get domain "$1" name ""
|
domain=""; config_get domain "$1" name ""
|
||||||
class=""; config_get class "$1" class ""
|
class=""; config_get class "$1" class ""
|
||||||
[ -n "$domain" ] && [ -n "$class" ] && [ -z "$(uci -q get dhcp.omr_dscp_$class.domain | grep $domain)" ] && {
|
[ -n "$domain" ] && [ -n "$class" ] && [ -z "$(uci -q get dhcp.omr_dscp_$class.domain | grep $domain)" ] && [ "$(uci -q get dhcp.dnsmasq1.filter_aaaa)" != "1" ]&& {
|
||||||
uci -q batch <<-EOF
|
uci -q batch <<-EOF
|
||||||
add_list dhcp.omr_dscp_$class.domain="$domain"
|
add_list dhcp.omr_dscp_$class.domain="$domain"
|
||||||
commit dhcp
|
commit dhcp
|
||||||
|
@ -60,7 +60,7 @@ _add_dscp_domains_rules() {
|
||||||
set firewall.omr_dscp_rule_${class}_4.ipset="omr_dscp_${class}_4"
|
set firewall.omr_dscp_rule_${class}_4.ipset="omr_dscp_${class}_4"
|
||||||
set firewall.omr_dscp_rule_${class}_4.set_dscp="$(echo ${class} | tr '[a-z'] '[A-Z]')"
|
set firewall.omr_dscp_rule_${class}_4.set_dscp="$(echo ${class} | tr '[a-z'] '[A-Z]')"
|
||||||
set firewall.omr_dscp_rule_${class}_4.target='DSCP'
|
set firewall.omr_dscp_rule_${class}_4.target='DSCP'
|
||||||
set firewall.omr_dscp_rule_${class}_4.src='lan'
|
set firewall.omr_dscp_rule_${class}_4.src='*'
|
||||||
set firewall.omr_dscp_rule_${class}_4.dest='*'
|
set firewall.omr_dscp_rule_${class}_4.dest='*'
|
||||||
commit firewall
|
commit firewall
|
||||||
EOF
|
EOF
|
||||||
|
@ -71,7 +71,7 @@ _add_dscp_domains_rules() {
|
||||||
set firewall.omr_dscp_rule_${class}_6.ipset="omr_dscp_${class}_6"
|
set firewall.omr_dscp_rule_${class}_6.ipset="omr_dscp_${class}_6"
|
||||||
set firewall.omr_dscp_rule_${class}_6.target='DSCP'
|
set firewall.omr_dscp_rule_${class}_6.target='DSCP'
|
||||||
set firewall.omr_dscp_rule_${class}_6.set_dscp="$(echo ${class} | tr '[a-z'] '[A-Z]')"
|
set firewall.omr_dscp_rule_${class}_6.set_dscp="$(echo ${class} | tr '[a-z'] '[A-Z]')"
|
||||||
set firewall.omr_dscp_rule_${class}_6.src='lan'
|
set firewall.omr_dscp_rule_${class}_6.src='*'
|
||||||
set firewall.omr_dscp_rule_${class}_6.dest='*'
|
set firewall.omr_dscp_rule_${class}_6.dest='*'
|
||||||
commit firewall
|
commit firewall
|
||||||
EOF
|
EOF
|
||||||
|
@ -93,32 +93,42 @@ _add_dscp_rules() {
|
||||||
dest_port="$(echo $dest_port | sed 's/:/-/g')"
|
dest_port="$(echo $dest_port | sed 's/:/-/g')"
|
||||||
count=$((count + 1))
|
count=$((count + 1))
|
||||||
[ "$proto" = "all" ] && proto="tcp udp"
|
[ "$proto" = "all" ] && proto="tcp udp"
|
||||||
|
src=""
|
||||||
|
dst=""
|
||||||
case "$direction" in
|
case "$direction" in
|
||||||
upload|both)
|
upload)
|
||||||
# Apply the rule locally
|
src="lan"
|
||||||
uci -q batch <<-EOF
|
|
||||||
set firewall.omr_dscp_rule$count=rule
|
|
||||||
set firewall.omr_dscp_rule$count.name="omr_dscp_rule$count"
|
|
||||||
set firewall.omr_dscp_rule$count.target="DSCP"
|
|
||||||
set firewall.omr_dscp_rule$count.set_dscp="$(echo ${class} | tr '[a-z'] '[A-Z]')"
|
|
||||||
set firewall.omr_dscp_rule$count.src="lan"
|
|
||||||
set firewall.omr_dscp_rule$count.src_ip="$src_ip"
|
|
||||||
set firewall.omr_dscp_rule$count.dest_ip="$dest_ip"
|
|
||||||
set firewall.omr_dscp_rule$count.proto="$proto"
|
|
||||||
EOF
|
|
||||||
src_port="$(echo $src_port | sed 's/,/ /g')"
|
|
||||||
dest_port="$(echo $dest_port | sed 's/,/ /g')"
|
|
||||||
for port in $src_port; do
|
|
||||||
uci -q set firewall.omr_dscp_rule$count.src_port="$src_port"
|
|
||||||
done
|
|
||||||
for port in $src_port; do
|
|
||||||
uci -q set firewall.omr_dscp_rule$count.dest_port="$dest_port"
|
|
||||||
done
|
|
||||||
#_add_dscp_rule -m multiport --sports "$src_port" -m multiport --dports "$dest_port"
|
|
||||||
;;
|
;;
|
||||||
download|both)
|
download)
|
||||||
|
dst="lan"
|
||||||
|
;;
|
||||||
|
both)
|
||||||
|
# to also use local generated traffic, maybe a local origin should be set...
|
||||||
|
src="*"
|
||||||
|
dst="*"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
# Apply the rule locally
|
||||||
|
uci -q batch <<-EOF
|
||||||
|
set firewall.omr_dscp_rule$count=rule
|
||||||
|
set firewall.omr_dscp_rule$count.name="omr_dscp_rule$count"
|
||||||
|
set firewall.omr_dscp_rule$count.target="DSCP"
|
||||||
|
set firewall.omr_dscp_rule$count.set_dscp="$(echo ${class} | tr '[a-z'] '[A-Z]')"
|
||||||
|
set firewall.omr_dscp_rule$count.src="$src"
|
||||||
|
set firewall.omr_dscp_rule$count.dest="$dst"
|
||||||
|
set firewall.omr_dscp_rule$count.src_ip="$src_ip"
|
||||||
|
set firewall.omr_dscp_rule$count.dest_ip="$dest_ip"
|
||||||
|
set firewall.omr_dscp_rule$count.proto="$proto"
|
||||||
|
EOF
|
||||||
|
src_port="$(echo $src_port | sed 's/,/ /g')"
|
||||||
|
dest_port="$(echo $dest_port | sed 's/,/ /g')"
|
||||||
|
for port in $src_port; do
|
||||||
|
uci -q add_list firewall.omr_dscp_rule$count.src_port="$src_port"
|
||||||
|
done
|
||||||
|
for port in $src_port; do
|
||||||
|
uci -q add_list firewall.omr_dscp_rule$count.dest_port="$dest_port"
|
||||||
|
done
|
||||||
|
#_add_dscp_rule -m multiport --sports "$src_port" -m multiport --dports "$dest_port"
|
||||||
uci -q commit firewall
|
uci -q commit firewall
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,8 @@ include $(TOPDIR)/rules.mk
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=shadowsocks-rust
|
PKG_NAME:=shadowsocks-rust
|
||||||
PKG_VERSION:=1.20.1
|
PKG_VERSION:=1.20.2
|
||||||
PKG_HASH:=95bef16ced3d937e085fdce0bc8de33e156c00bdc9c10100778d3e3ff4df95f0
|
PKG_HASH:=555f0680621d6ebe19eb6b91356068ca7afabf5ef502bbe2a85d779af03e45b9
|
||||||
#PKG_VERSION:=1.19.3
|
|
||||||
#PKG_HASH:=d2ba10b56ae54378df40215705be6a5eee1ca96f30f4c59bc4fa001c1d6f676f
|
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
|
Loading…
Reference in a new issue