1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
This commit is contained in:
Ycarus 2018-02-22 22:32:09 +01:00
parent 03b8e9a6cf
commit 6cedb31490
9 changed files with 29 additions and 40 deletions

View file

@ -55,6 +55,7 @@ define Package/luci-app-haproxy-tcp/prerm
/etc/init.d/haproxy-tcp disable
/etc/init.d/haproxy-tcp stop
rm -f /usr/sbin/haproxy-tcp
rm -f /etc/hotplug.d/net/90-haproxy
exit 0
endef

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View file

@ -25,8 +25,6 @@ _setup_interface() {
config_get _type "$1" type
[ "$_type" = "macvlan" ] || return 0
sleep 1
uci -q batch <<-EOF
set network.$1_dev=device
set network.$1_dev.name=$1

View file

@ -34,12 +34,13 @@ set_default() {
}
local iface
config_get iface "$config" ifname
ip route del default
ip route add default scope global nexthop via $gateway dev $iface || {
[ -n "gateway" ] && {
ip route replace default via $gateway dev $iface || {
#Fallback: use upcomming interface...
network_get_gateway gateway $INTERFACE
ip route add default scope global nexthop via $gateway dev $INTERFACE
logger -t multipath Faild to set default multipath device! Use $INTERFACE as fallback...
ip route replace default via $gateway dev $INTERFACE
logger -t multipath Failed to set default multipath device! Use $INTERFACE as fallback...
}
}
}
}
@ -47,8 +48,8 @@ set_default() {
config_load network
config_foreach set_default interface
[ $id = 0 ] && {
logger -t multipath device $INTERFACE not fount!
echo device $INTERFACE not fount!
logger -t multipath device $INTERFACE not found!
echo device $INTERFACE not found!
exit 1
}
@ -73,10 +74,6 @@ multipath $DEVICE $mode
# IPv4 Updates:
local ipaddr
local gateway
local network
local netmask
network_get_ipaddr ipaddr $INTERFACE
network_get_gateway gateway $INTERFACE
network_get_subnet network $INTERFACE

View file

@ -8,7 +8,6 @@ USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command hotplug-call net
procd_set_param respawn
procd_set_param watch network.globals
procd_close_instance
}

View file

@ -0,0 +1,7 @@
#!/bin/sh
# vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 :
HOST="proof.ovh.net"
trap : HUP INT TERM
curl http://$HOST/files/10Gio.dat >/dev/null || echo

View file

@ -1,24 +0,0 @@
#!/bin/sh
# vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 :
HOST="proof.ovh.net"
_ipt() {
iptables -w -t nat "$1" socks_emitted_by_myself \
-d "$HOST" -j socks_redir -m comment --comment "Test download proof"
}
_chain_exists() {
iptables -w -t nat -nL "$1" 1>/dev/null 2>/dev/null
}
if ! _chain_exists "socks_emitted_by_myself" || ! _chain_exists "socks_redir"; then
echo "Couldn't find the iptables chain to plug myself into. Is ss-redir running?"
return 1
fi
trap : HUP INT TERM
_ipt -A
curl http://$HOST/files/10Gio.dat >/dev/null || echo
_ipt -D

View file

@ -0,0 +1,11 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
set luci.diag.ping=openmptcprouter.com
set luci.diag.dns=openmptcprouter.com
set luci.diag.route=openmptcprouter.com
commit luci
EOF
rm -f /tmp/luci-indexcache
exit 0

View file

@ -245,7 +245,7 @@ stop_service() {
}
service_triggers() {
procd_add_reload_interface_trigger wan
procd_add_reload_interface_trigger wan*
procd_add_reload_trigger shadowsocks-libev
procd_open_validate
validate_server_section