mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix merge
This commit is contained in:
commit
8e9389f476
160 changed files with 26795 additions and 3701 deletions
|
@ -24,6 +24,7 @@ define Package/mptcp
|
|||
DEPENDS:=+ip +iptables +ethtool +ipcalc
|
||||
KCONFIG:=\
|
||||
CONFIG_MPTCP=y \
|
||||
CONFIG_MPTCP_IPV6=y \
|
||||
CONFIG_MPTCP_BINDER=y \
|
||||
CONFIG_MPTCP_FULLMESH=y \
|
||||
CONFIG_MPTCP_NDIFFPORTS=y \
|
||||
|
|
|
@ -16,6 +16,9 @@ global_multipath_settings() {
|
|||
config_get multipath globals multipath
|
||||
config_get mptcp_path_manager globals mptcp_path_manager
|
||||
config_get mptcp_scheduler globals mptcp_scheduler
|
||||
config_get mptcp_subflows globals mptcp_subflows "3"
|
||||
config_get mptcp_add_addr_accepted globals mptcp_add_addr_accepted "1"
|
||||
config_get mptcp_add_addr_timeout globals mptcp_add_addr_timeout "120"
|
||||
config_get mptcp_debug globals mptcp_debug
|
||||
config_get congestion globals congestion
|
||||
config_get mptcp_checksum globals mptcp_checksum
|
||||
|
@ -29,18 +32,25 @@ global_multipath_settings() {
|
|||
[ "$multipath" = "enable" ] && multipath_status=1
|
||||
|
||||
# Global MPTCP configuration
|
||||
sysctl -qw net.mptcp.mptcp_enabled="$multipath_status"
|
||||
[ -z "$mptcp_path_manager" ] || sysctl -qw net.mptcp.mptcp_path_manager="$mptcp_path_manager"
|
||||
[ -z "$mptcp_scheduler" ] || sysctl -qw net.mptcp.mptcp_scheduler="$mptcp_scheduler"
|
||||
[ -z "$congestion" ] || sysctl -qw net.ipv4.tcp_congestion_control="$congestion"
|
||||
[ -z "$mptcp_checksum" ] || sysctl -qw net.mptcp.mptcp_checksum="$mptcp_checksum"
|
||||
[ -z "$mptcp_debug" ] || sysctl -qw net.mptcp.mptcp_debug="$mptcp_debug"
|
||||
[ -z "$mptcp_syn_retries" ] || sysctl -qw net.mptcp.mptcp_syn_retries="$mptcp_syn_retries"
|
||||
[ -z "$mptcp_fullmesh_num_subflows" ] || sysctl -qw /sys/module/mptcp_fullmesh/parameters/num_subflows="$mptcp_fullmesh_num_subflows"
|
||||
[ -z "$mptcp_fullmesh_create_on_err" ] || sysctl -qw /sys/module/mptcp_fullmesh/parameters/create_on_err="$mptcp_fullmesh_create_on_err"
|
||||
[ -z "$mptcp_ndiffports_num_subflows" ] || sysctl -qw /sys/module/mptcp_ndiffports/parameters/num_subflows="$mptcp_ndiffports_num_subflows"
|
||||
[ -z "$mptcp_rr_cwnd_limited" ] || sysctl -qw /sys/module/mptcp_rr/parameters/cwnd_limited="$mptcp_rr_cwnd_limited"
|
||||
[ -z "$mptcp_rr_num_segments" ] || sysctl -qw /sys/module/mptcp_rr/parameters/num_segments="$mptcp_rr_num_segments"
|
||||
if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||
sysctl -qew net.mptcp.mptcp_enabled="$multipath_status"
|
||||
[ -z "$mptcp_path_manager" ] || sysctl -qew net.mptcp.mptcp_path_manager="$mptcp_path_manager"
|
||||
[ -z "$mptcp_scheduler" ] || sysctl -qew net.mptcp.mptcp_scheduler="$mptcp_scheduler"
|
||||
[ -z "$mptcp_checksum" ] || sysctl -qew net.mptcp.mptcp_checksum="$mptcp_checksum"
|
||||
[ -z "$mptcp_debug" ] || sysctl -qew net.mptcp.mptcp_debug="$mptcp_debug"
|
||||
[ -z "$mptcp_syn_retries" ] || sysctl -qew net.mptcp.mptcp_syn_retries="$mptcp_syn_retries"
|
||||
[ -z "$mptcp_fullmesh_num_subflows" ] || sysctl -qew /sys/module/mptcp_fullmesh/parameters/num_subflows="$mptcp_fullmesh_num_subflows"
|
||||
[ -z "$mptcp_fullmesh_create_on_err" ] || sysctl -qew /sys/module/mptcp_fullmesh/parameters/create_on_err="$mptcp_fullmesh_create_on_err"
|
||||
[ -z "$mptcp_ndiffports_num_subflows" ] || sysctl -qew /sys/module/mptcp_ndiffports/parameters/num_subflows="$mptcp_ndiffports_num_subflows"
|
||||
[ -z "$mptcp_rr_cwnd_limited" ] || sysctl -qew /sys/module/mptcp_rr/parameters/cwnd_limited="$mptcp_rr_cwnd_limited"
|
||||
[ -z "$mptcp_rr_num_segments" ] || sysctl -qew /sys/module/mptcp_rr/parameters/num_segments="$mptcp_rr_num_segments"
|
||||
else
|
||||
sysctl -qew net.mptcp.enabled="$multipath_status"
|
||||
ip mptcp limits set add_addr_accepted $mptcp_add_addr_accepted subflows $mptcp_subflows 2>&1 >/dev/null
|
||||
[ -z "$mptcp_add_addr_timeout" ] || sysctl -qew net.mptcp.add_addr_timeout="$mptcp_add_addr_timeout"
|
||||
[ -z "$mptcp_checksum" ] || sysctl -qew net.mptcp.checksum_enabled="$mptcp_checksum"
|
||||
fi
|
||||
[ -z "$congestion" ] || sysctl -qew net.ipv4.tcp_congestion_control="$congestion"
|
||||
}
|
||||
|
||||
interface_macaddr_count() {
|
||||
|
@ -202,6 +212,7 @@ interface_multipath_settings() {
|
|||
[ -n "$netmask" ] && [ "$(echo $netmask | grep '/')" != "" ] && netmask=""
|
||||
[ -z "$netmask" ] && netmask=$(ip -4 addr show dev $iface | grep peer | awk '{print $4}' | cut -d/ -f2 | tr -d "\n")
|
||||
[ -z "$netmask" ] && netmask=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f2 | tr -d "\n")
|
||||
[ -n "$ipaddr" ] && ipaddr=$(echo $ipaddr | cut -d/ -f1 | tr -d "\n")
|
||||
[ -n "$ipaddr" ] && [ -n "$netmask" ] && netmask=`ipcalc.sh $ipaddr $netmask | sed -n '/PREFIX=/{;s/.*=//;s/ .*//;p;}'`
|
||||
[ -n "$ipaddr" ] && [ -n "$netmask" ] && network=`ipcalc.sh $ipaddr $netmask | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'`
|
||||
fi
|
||||
|
@ -255,10 +266,10 @@ interface_multipath_settings() {
|
|||
|
||||
#config_get mode "$config" multipath ""
|
||||
#[ "$mode" = "" ] && mode="$(uci -q get openmptcprouter.${config}.multipath)"
|
||||
[ "$mode" = "master" ] && {
|
||||
#echo "ip route replace default via $gateway dev $iface"
|
||||
ip route replace default via $gateway dev $iface 2>&1 >/dev/null
|
||||
}
|
||||
#[ "$mode" = "master" ] && {
|
||||
# #echo "ip route replace default via $gateway dev $iface"
|
||||
# ip route replace default via $gateway dev $iface 2>&1 >/dev/null
|
||||
#}
|
||||
if [ "$txqueuelen" != "" ]; then
|
||||
ifconfig $iface txqueuelen $txqueuelen > /dev/null 2>&1
|
||||
else
|
||||
|
@ -278,20 +289,20 @@ interface_multipath_settings() {
|
|||
ip6addr=`echo $ip6addr | cut -d/ -f1`
|
||||
netmask6=`ipcalc $ipaddr6 | sed -n '/PREFIX=/{;s/.*=//;s/ .*//;p;}'`
|
||||
network6=`ipcalc $ip6addr | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'`
|
||||
if [ -z "$ip6addr" ] || [ -z "$network6" ]; then
|
||||
ip6addr=$(ip -6 addr show dev $iface | grep -v 'scope link' | grep inet6 | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
||||
gateway6=$(ip -6 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n")
|
||||
[ -z "$gateway6" ] && gateway6=$(uci -q get "network.$config.ip6gw")
|
||||
[ -z "$gateway6" ] && gateway6=$(ubus call network.interface.$config status | jsonfilter -q -l 1 -e '@.inactive.route[@.target="::"].nexthop' | tr -d "\n")
|
||||
if [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6 )" != "ok" ]; then
|
||||
gateway6=$(ubus call network.interface.$config status | jsonfilter -q -l 1 -e '@.route[@.target="::"].nexthop' | tr -d "\n")
|
||||
fi
|
||||
if [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6 )" != "ok" ]; then
|
||||
gateway6=$(ubus call network.interface.${config}_6 status 2>/dev/null | jsonfilter -q -l 1 -e '@.inactive.route[@.target="::"].nexthop' | tr -d "\n")
|
||||
fi
|
||||
netmask6=$(ip -6 addr show dev $iface | grep -v 'scope link' | grep inet6 | awk '{print $2}' | cut -d/ -f2 | tr -d "\n")
|
||||
network6=`ipcalc $ip6addr | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'`
|
||||
fi
|
||||
if [ -z "$ip6addr" ] || [ -z "$network6" ]; then
|
||||
ip6addr=$(ip -6 addr show dev $iface | grep -v 'scope link' | grep inet6 | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
||||
gateway6=$(ip -6 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n")
|
||||
[ -z "$gateway6" ] && gateway6=$(uci -q get "network.$config.ip6gw")
|
||||
[ -z "$gateway6" ] && gateway6=$(ubus call network.interface.$config status | jsonfilter -q -l 1 -e '@.inactive.route[@.target="::"].nexthop' | tr -d "\n")
|
||||
if [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6 )" != "ok" ]; then
|
||||
gateway6=$(ubus call network.interface.$config status | jsonfilter -q -l 1 -e '@.route[@.target="::"].nexthop' | tr -d "\n")
|
||||
fi
|
||||
if [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6 )" != "ok" ]; then
|
||||
gateway6=$(ubus call network.interface.${config}_6 status 2>/dev/null | jsonfilter -q -l 1 -e '@.inactive.route[@.target="::"].nexthop' | tr -d "\n")
|
||||
fi
|
||||
netmask6=$(ip -6 addr show dev $iface | grep -v 'scope link' | grep inet6 | awk '{print $2}' | cut -d/ -f2 | tr -d "\n")
|
||||
network6=`ipcalc $ip6addr | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'`
|
||||
fi
|
||||
if [ "$(uci -q get openmptcprouter.settings.uci_route)" = "1" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
|
@ -304,7 +315,7 @@ interface_multipath_settings() {
|
|||
[ -n "$(ip -6 rule list | grep 6$id)" ] && ip -6 rule del table 6$id > /dev/null 2>&1
|
||||
ip -6 route flush 6$id > /dev/null 2>&1
|
||||
fi
|
||||
if [ -n "$ip6addr" ] && [ -n "$gateway6" ] && [ -n "$network6" ]; then
|
||||
if [ -n "$gateway6" ] && [ -n "$network6" ]; then
|
||||
if [ "$(uci -q get openmptcprouter.settings.uci_route)" = "1" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete network.${config}_rule6
|
||||
|
@ -329,18 +340,18 @@ interface_multipath_settings() {
|
|||
commit network
|
||||
EOF
|
||||
else
|
||||
ip -6 rule add from $ip6addr table 6$id pref 0 2>&1 >/dev/null
|
||||
[ -n "$ip6addr" ] && ip -6 rule add from $ip6addr table 6$id pref 0 2>&1 >/dev/null
|
||||
ip -6 route replace $network6/$netmask6 dev $iface scope link metric 6$id 2>&1 >/dev/null
|
||||
ip -6 route replace $network6/$netmask6 dev $iface scope link table 6$id 2>&1 >/dev/null
|
||||
ip -6 route replace default via $gateway6 dev $iface table 6$id 2>&1 >/dev/null
|
||||
ip -6 route replace default via $gateway6 dev $iface metric 6$id 2>&1 >/dev/null
|
||||
ip -6 route flush 6$id 2>&1 >/dev/null
|
||||
#ip -6 route flush 6$id 2>&1 >/dev/null
|
||||
fi
|
||||
|
||||
#config_get mode "$config" multipath "off"
|
||||
[ "$mode" = "master" ] && {
|
||||
ip -6 route replace default via $gateway6 dev $iface 2>&1 >/dev/null
|
||||
}
|
||||
#[ "$mode" = "master" ] && {
|
||||
# ip -6 route replace default via $gateway6 dev $iface 2>&1 >/dev/null
|
||||
#}
|
||||
#[ "$mode" = "off" ] && {
|
||||
# ifconfig $iface txqueuelen 50 > /dev/null 2>&1
|
||||
#} || {
|
||||
|
@ -351,7 +362,9 @@ interface_multipath_settings() {
|
|||
}
|
||||
|
||||
load_interfaces() {
|
||||
ifname=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
|
||||
network_get_device ifname $1
|
||||
[ -z "$ifname" ] && network_get_physdev ifname $1
|
||||
[ -z "$ifname" ] && config_get ifname "$1" device
|
||||
[ -z "$ifname" ] && config_get ifname "$1" ifname
|
||||
config_get multipath "$1" multipath ""
|
||||
[ -z "$multipath" ] && multipath="$(uci -q get openmptcprouter.$1.multipath)"
|
||||
|
@ -476,6 +489,10 @@ start_service() {
|
|||
[ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep raspberry)" ] && [ -z "$(ubus call system board | jsonfilter -e '@.board_name' | grep '4-model-b')" ] && {
|
||||
ethtool --offload eth0 rx off tx off > /dev/null 2>&1
|
||||
}
|
||||
[ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep -i r2s)" ] && {
|
||||
ethtool -K eth0 rx off tx off > /dev/null 2>&1
|
||||
ethtool -K eth1 rx off tx off > /dev/null 2>&1
|
||||
}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
|
|
@ -8,6 +8,9 @@ if [ "$(uci -q get network.globals.mptcp_path_manager)" = "" ]; then
|
|||
set network.globals.mptcp_checksum=0
|
||||
set network.globals.mptcp_debug=0
|
||||
set network.globals.mptcp_syn_retries=2
|
||||
set network.globals.mptcp_subflows=3
|
||||
set network.globals.mptcp_add_addr_accepted=1
|
||||
set network.globals.mptcp_add_addr_timeout=120
|
||||
commit network
|
||||
EOF
|
||||
fi
|
||||
|
@ -53,6 +56,15 @@ if [ "$(uci -q show network.globals | grep mptcp_fullmesh)" = "" ]; then
|
|||
commit network
|
||||
EOF
|
||||
fi
|
||||
if [ "$(uci -q get network.globals.mptcp_subflows)" = "" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set network.globals.mptcp_subflows=3
|
||||
set network.globals.mptcp_add_addr_accepted=1
|
||||
set network.globals.mptcp_add_addr_timeout=120
|
||||
commit network
|
||||
EOF
|
||||
fi
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@mptcp[-1]
|
||||
add ucitrack mptcp
|
||||
|
|
|
@ -6,15 +6,12 @@
|
|||
# Released under GPL 3 or later
|
||||
|
||||
if [ -d "/proc/sys/net/mptcp" ]; then
|
||||
if [ `cat /proc/sys/net/mptcp/mptcp_enabled` = 0 ]; then
|
||||
if ([ -f /proc/sys/net/mptcp/mptcp_enabled ] && [ `cat /proc/sys/net/mptcp/mptcp_enabled` = 0 ]) || ([ -f /proc/sys/net/mptcp/enabled ] && [ `cat /proc/sys/net/mptcp/enabled` = 0 ]); then
|
||||
echo "MPTCP is disabled!"
|
||||
echo "Please set net.mptcp.mptcp_enabled = 1"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Your device don't support multipath-TCP."
|
||||
echo "You have to install the pached kernel to use MPTCP."
|
||||
echo "See http://multipath-tcp.org/ for details"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -23,7 +20,11 @@ case $1 in
|
|||
echo " Multipath-TCP configuration tool"
|
||||
echo "show/update flags:"
|
||||
echo " multipath [device]"
|
||||
echo " multipath device {on | off | backup | handover}"
|
||||
if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||
echo " multipath device {on | off | backup }"
|
||||
else
|
||||
echo " multipath device {on | off | signal | backup }"
|
||||
fi
|
||||
echo
|
||||
echo "show established conections: -c"
|
||||
echo "show fullmesh info: -f"
|
||||
|
@ -33,24 +34,46 @@ case $1 in
|
|||
echo "will allow a subflow to be established across this interface, but only be used"
|
||||
echo "as backup. Handover-flag indicates that his interface is not used at all (even "
|
||||
echo "no subflow being established), as long as there are other interfaces available."
|
||||
echo "See http://multipath-tcp.org/ for details"
|
||||
echo
|
||||
exit 0 ;;
|
||||
"-c")
|
||||
cat /proc/net/mptcp_net/mptcp
|
||||
if [ -f /proc/net/mptcp_net/mptcp ]; then
|
||||
cat /proc/net/mptcp_net/mptcp
|
||||
else
|
||||
ss -M
|
||||
fi
|
||||
exit 0;;
|
||||
"-f")
|
||||
cat /proc/net/mptcp_fullmesh
|
||||
if [ -f /proc/net/mptcp_fullmesh ]; then
|
||||
cat /proc/net/mptcp_fullmesh
|
||||
else
|
||||
ip mptcp endpoint | grep fullmesh
|
||||
fi
|
||||
exit 0;;
|
||||
"-k")
|
||||
echo Enabled: `cat /proc/sys/net/mptcp/mptcp_enabled`
|
||||
echo Path Manager: `cat /proc/sys/net/mptcp/mptcp_path_manager`
|
||||
echo Use checksum: `cat /proc/sys/net/mptcp/mptcp_checksum`
|
||||
echo Scheduler: `cat /proc/sys/net/mptcp/mptcp_scheduler`
|
||||
echo Syn retries: `cat /proc/sys/net/mptcp/mptcp_syn_retries`
|
||||
echo Debugmode: `cat /proc/sys/net/mptcp/mptcp_debug`
|
||||
if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||
echo Enabled: `cat /proc/sys/net/mptcp/mptcp_enabled`
|
||||
elif [ -f /proc/sys/net/mptcp/enabled ]; then
|
||||
echo Enabled: `cat /proc/sys/net/mptcp/enabled`
|
||||
fi
|
||||
if [ -f /proc/sys/net/mptcp/mptcp_path_manager ]; then
|
||||
echo Path Manager: `cat /proc/sys/net/mptcp/mptcp_path_manager`
|
||||
fi
|
||||
if [ -f /proc/sys/net/mptcp/mptcp_checksum ]; then
|
||||
echo Use checksum: `cat /proc/sys/net/mptcp/mptcp_checksum`
|
||||
else
|
||||
echo Use checksum: `cat /proc/sys/net/mptcp/checksum_enabled`
|
||||
fi
|
||||
if [ -f /proc/sys/net/mptcp/mptcp_scheduler ]; then
|
||||
echo Scheduler: `cat /proc/sys/net/mptcp/mptcp_scheduler`
|
||||
fi
|
||||
if [ -f /proc/sys/net/mptcp/mptcp_syn_retries ]; then
|
||||
echo Syn retries: `cat /proc/sys/net/mptcp/mptcp_syn_retries`
|
||||
fi
|
||||
if [ -f /proc/sys/net/mptcp/mptcp_debug ]; then
|
||||
echo Debugmode: `cat /proc/sys/net/mptcp/mptcp_debug`
|
||||
fi
|
||||
echo
|
||||
echo See http://multipath-tcp.org/ for details
|
||||
exit 0 ;;
|
||||
"")
|
||||
for ifpath in /sys/class/net/*; do
|
||||
|
@ -70,33 +93,68 @@ TYPE="$2"
|
|||
exit 1
|
||||
}
|
||||
|
||||
FLAG_PATH="/sys/class/net/$DEVICE/flags"
|
||||
IFF=`cat $FLAG_PATH`
|
||||
if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||
FLAG_PATH="/sys/class/net/$DEVICE/flags"
|
||||
IFF=`cat $FLAG_PATH`
|
||||
|
||||
IFF_OFF="0x80000"
|
||||
IFF_ON="0x00"
|
||||
IFF_BACKUP="0x100000"
|
||||
IFF_HANDOVER="0x200000"
|
||||
IFF_MASK="0x380000"
|
||||
IFF_OFF="0x80000"
|
||||
IFF_ON="0x00"
|
||||
IFF_BACKUP="0x100000"
|
||||
IFF_HANDOVER="0x200000"
|
||||
IFF_MASK="0x380000"
|
||||
|
||||
case $TYPE in
|
||||
"off") FLAG=$IFF_OFF;;
|
||||
"on") FLAG=$IFF_ON;;
|
||||
"backup") FLAG=$IFF_BACKUP;;
|
||||
"handover") FLAG=$IFF_HANDOVER;;
|
||||
"")
|
||||
IFF=`printf "0x%02x" $(($IFF&$IFF_MASK))`
|
||||
case "$IFF" in
|
||||
$IFF_OFF) echo $DEVICE is deactivated;;
|
||||
$IFF_ON) echo $DEVICE is in default mode;;
|
||||
$IFF_BACKUP) echo $DEVICE is in backup mode;;
|
||||
$IFF_HANDOVER) echo $DEVICE is in handover mode;;
|
||||
*) echo "Unkown state!" && exit 1;;
|
||||
esac
|
||||
exit 0;;
|
||||
*) echo "Unkown flag! Use 'multipath -h' for help" && exit 1;;
|
||||
esac
|
||||
case $TYPE in
|
||||
"off") FLAG=$IFF_OFF;;
|
||||
"on") FLAG=$IFF_ON;;
|
||||
"backup") FLAG=$IFF_BACKUP;;
|
||||
"handover") FLAG=$IFF_HANDOVER;;
|
||||
"")
|
||||
IFF=`printf "0x%02x" $(($IFF&$IFF_MASK))`
|
||||
case "$IFF" in
|
||||
$IFF_OFF) echo $DEVICE is deactivated;;
|
||||
$IFF_ON) echo $DEVICE is in default mode;;
|
||||
$IFF_BACKUP) echo $DEVICE is in backup mode;;
|
||||
$IFF_HANDOVER) echo $DEVICE is in handover mode;;
|
||||
*) echo "Unkown state!" && exit 1;;
|
||||
esac
|
||||
exit 0;;
|
||||
*) echo "Unkown flag! Use 'multipath -h' for help" && exit 1;;
|
||||
esac
|
||||
|
||||
printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH
|
||||
printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH
|
||||
else
|
||||
ID=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $3}')
|
||||
IFF=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $4}')
|
||||
IP=$(ifconfig $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
|
||||
case $TYPE in
|
||||
"off")
|
||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||
exit 0;;
|
||||
"on")
|
||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||
ip mptcp endpoint add $IP dev $DEVICE subflow fullmesh
|
||||
exit 0;;
|
||||
"signal")
|
||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||
#ip mptcp endpoint add $IP dev $DEVICE signal subflow fullmesh
|
||||
ip mptcp endpoint add $IP dev $DEVICE signal
|
||||
exit 0;;
|
||||
"backup")
|
||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||
ip mptcp endpoint add $IP dev $DEVICE backup fullmesh
|
||||
exit 0;;
|
||||
"")
|
||||
case "$IFF" in
|
||||
"") echo $DEVICE is deactivated;;
|
||||
"subflow") echo $DEVICE is in default mode;;
|
||||
"backup") echo $DEVICE is in backup mode;;
|
||||
"signal") echo $DEVICE is in signal mode;;
|
||||
"fullmesh") echo $DEVICE is in fullmesh mode;;
|
||||
*) echo "$DEVICE Unkown state!" && exit 1;;
|
||||
esac
|
||||
exit 0;;
|
||||
*) echo "Unkown flag! Use 'multipath -h' for help" && exit 1;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,20 +1,45 @@
|
|||
SETROUTE=false
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
find_network_device() {
|
||||
local device="${1}"
|
||||
local device_section=""
|
||||
|
||||
check_device() {
|
||||
local cfg="${1}"
|
||||
local device="${2}"
|
||||
|
||||
local type name
|
||||
config_get name "${cfg}" name
|
||||
|
||||
[ "${name}" = "${device}" ] && device_section="${cfg}"
|
||||
}
|
||||
if [ ! -z "$device" ]; then
|
||||
config_load network
|
||||
config_foreach check_device device "$(uci -q network.${device}.device)"
|
||||
fi
|
||||
echo "${device_section}"
|
||||
}
|
||||
|
||||
set_route() {
|
||||
local multipath_config_route interface_gw interface_if
|
||||
INTERFACE=$1
|
||||
PREVINTERFACE=$2
|
||||
SETDEFAULT=$3
|
||||
[ -z "$SETDEFAULT" ] && SETDEFAULT="yes"
|
||||
[ -z "$INTERFACE" ] && return
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
|
||||
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ] && multipath_config_route="$(uci -q get openmptcprouter.ovpn${INTERFACE}.multipath || echo "off")"
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "wireguard" ] && multipath_config_route="$(uci -q get openmptcprouter.wg${INTERFACE}.multipath || echo "off")"
|
||||
}
|
||||
interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
network_get_device interface_if $INTERFACE
|
||||
interface_up=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${INTERFACE}_4" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.ifname)
|
||||
[ -n "$(echo $interface_if | grep '@')" ] && interface_if=$(ifstatus "${INTERFACE}" | jsonfilter -q -e '@["device"]')
|
||||
interface_current_config=$(uci -q get openmptcprouter.$INTERFACE.state || echo "up")
|
||||
|
@ -30,7 +55,8 @@ set_route() {
|
|||
interface_gw=$(ubus call network.interface.${INTERFACE}_4 status 2>/dev/null | jsonfilter -q -l 1 -e '@.inactive.route[@.target="0.0.0.0"].nexthop' | tr -d "\n")
|
||||
fi
|
||||
if [ "$interface_gw" != "" ] && [ "$interface_if" != "" ]; then
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "$PREVINTERFACE down. Replace default route by $interface_gw dev $interface_if"
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && [ "$SETDEFAULT" = "yes" ] && _log "$PREVINTERFACE down. Replace default route by $interface_gw dev $interface_if"
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && [ "$SETDEFAULT" != "yes" ] && _log "$PREVINTERFACE down. Replace default in table 991337 route by $interface_gw dev $interface_if"
|
||||
[ "$SETDEFAULT" = "yes" ] && ip route replace default scope global nexthop via $interface_gw dev $interface_if 2>&1 >/dev/null
|
||||
ip route replace default via $interface_gw dev $interface_if table 991337 2>&1 >/dev/null && SETROUTE=true
|
||||
fi
|
||||
|
@ -43,15 +69,18 @@ set_route6() {
|
|||
PREVINTERFACE=$2
|
||||
SETDEFAULT=$3
|
||||
[ -z "$SETDEFAULT" ] && SETDEFAULT="yes"
|
||||
[ -z "$INTERFACE" ] && return
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
|
||||
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ] && multipath_config_route="$(uci -q get openmptcprouter.ovpn${INTERFACE}.multipath || echo "off")"
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "wireguard" ] && multipath_config_route="$(uci -q get openmptcprouter.wg${INTERFACE}.multipath || echo "off")"
|
||||
}
|
||||
interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
network_get_device interface_if $INTERFACE
|
||||
interface_up=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${INTERFACE}_4" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.ifname)
|
||||
[ -n "$(echo $interface_if | grep '@')" ] && interface_if=$(ifstatus "$INTERFACE" | jsonfilter -q -e '@["device"]')
|
||||
interface_current_config=$(uci -q get openmptcprouter.$INTERFACE.state || echo "up")
|
||||
|
@ -82,6 +111,7 @@ set_server_default_route() {
|
|||
[ -n "$serverip" ] && serverip="$(resolveip -4 -t 5 $serverip | head -n 1 | tr -d '\n')"
|
||||
config_get disabled $server disabled
|
||||
[ "$disabled" = "1" ] && return
|
||||
[ -z "$OMR_TRACKER_INTERFACE" ] && return
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipath)
|
||||
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$OMR_TRACKER_INTERFACE.multipath || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" = "1" ] && {
|
||||
|
@ -107,6 +137,7 @@ set_server_default_route6() {
|
|||
[ -n "$serverip" ] && serverip="$(resolveip -6 -t 5 $serverip | head -n 1 | tr -d '\n')"
|
||||
config_get disabled $server disabled
|
||||
[ "$disabled" = "1" ] && return
|
||||
[ -z "$OMR_TRACKER_INTERFACE" ] && return
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipath)
|
||||
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$OMR_TRACKER_INTERFACE.multipath || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" = "1" ] && {
|
||||
|
@ -157,14 +188,17 @@ delete_server_default_route6() {
|
|||
set_routes_intf() {
|
||||
local multipath_config_route
|
||||
local INTERFACE=$1
|
||||
[ -z "$INTERFACE" ] && return
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
|
||||
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ] && multipath_config_route="$(uci -q get openmptcprouter.ovpn${INTERFACE}.multipath || echo "off")"
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "wireguard" ] && multipath_config_route="$(uci -q get openmptcprouter.wg${INTERFACE}.multipath || echo "off")"
|
||||
}
|
||||
interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
network_get_device interface_if $INTERFACE
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${INTERFACE}_4" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.ifname)
|
||||
[ -n "$(echo $interface_if | grep '@')" ] && ifname=$(ifstatus "$INTERFACE" | jsonfilter -q -e '@["device"]')
|
||||
interface_up=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
|
@ -211,14 +245,17 @@ set_routes_intf() {
|
|||
set_routes_intf6() {
|
||||
local multipath_config_route
|
||||
local INTERFACE=$1
|
||||
[ -z "$INTERFACE" ] && return
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
|
||||
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ] && multipath_config_route="$(uci -q get openmptcprouter.ovpn${INTERFACE}.multipath || echo "off")"
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "wireguard" ] && multipath_config_route="$(uci -q get openmptcprouter.wg${INTERFACE}.multipath || echo "off")"
|
||||
}
|
||||
interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
network_get_device interface_if $INTERFACE
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${INTERFACE}_6" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.ifname)
|
||||
[ -n "$(echo $interface_if | grep '@')" ] && interface_if=$(ifstatus "$INTERFACE" | jsonfilter -q -e '@["device"]')
|
||||
interface_up=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
|
@ -281,14 +318,17 @@ set_routes_intf6() {
|
|||
set_route_balancing() {
|
||||
local multipath_config_route interface_gw interface_if
|
||||
INTERFACE=$1
|
||||
[ -z "$INTERFACE" ] && return
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
|
||||
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ] && multipath_config_route="$(uci -q get openmptcprouter.ovpn${INTERFACE}.multipath || echo "off")"
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "wireguard" ] && multipath_config_route="$(uci -q get openmptcprouter.wg${INTERFACE}.multipath || echo "off")"
|
||||
}
|
||||
interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
network_get_device interface_if $INTERFACE
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${INTERFACE}_4" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.ifname)
|
||||
[ -n "$(echo $interface_if | grep '@')" ] && interface_if=$(ifstatus "$INTERFACE" | jsonfilter -q -e '@["device"]')
|
||||
interface_up=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
|
@ -329,14 +369,17 @@ set_route_balancing() {
|
|||
set_route_balancing6() {
|
||||
local multipath_config_route interface_gw interface_if
|
||||
INTERFACE=$1
|
||||
[ -z "$INTERFACE" ] && return
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
|
||||
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ] && multipath_config_route="$(uci -q get openmptcprouter.ovpn${INTERFACE}.multipath || echo "off")"
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "wireguard" ] && multipath_config_route="$(uci -q get openmptcprouter.wg${INTERFACE}.multipath || echo "off")"
|
||||
}
|
||||
interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
network_get_device interface_if $INTERFACE
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${INTERFACE}_4" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.ifname)
|
||||
[ -n "$(echo $interface_if | grep '@')" ] && interface_if=$(ifstatus "$INTERFACE" | jsonfilter -q -e '@["device"]')
|
||||
interface_up=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
|
@ -392,16 +435,19 @@ set_route_balancing6() {
|
|||
|
||||
set_server_all_routes() {
|
||||
local server=$1
|
||||
[ -z "$OMR_TRACKER_INTERFACE" ] && return
|
||||
server_route() {
|
||||
local serverip multipath_config_route
|
||||
serverip=$1
|
||||
[ -n "$serverip" ] && serverip="$(resolveip -4 -t 5 $serverip | head -n 1 | tr -d '\n')"
|
||||
config_get disabled $server disabled
|
||||
[ "$disabled" = "1" ] && return
|
||||
interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.ifname)
|
||||
network_get_device interface_if $OMR_TRACKER_INTERFACE
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${OMR_TRACKER_INTERFACE}_4" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$OMR_TRACKER_INTERFACE" | jsonfilter -q -e '@["device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.ifname)
|
||||
interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipath || echo "off")
|
||||
[ "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$OMR_TRACKER_INTERFACE.multipath || echo 'off')
|
||||
|
@ -418,7 +464,7 @@ set_server_all_routes() {
|
|||
config_foreach set_routes_intf interface
|
||||
uintf="$(echo $routesintf | awk '{print $5}')"
|
||||
uintfb="$(echo $routesintfbackup | awk '{print $5}')"
|
||||
if [ -n "$routesintf" ] && ([ "$nbintf" -gt "1" ] && [ "$(ip r show $serverip metric 1 | tr -d '\t' | tr -d '\n')" != "$serverip $routesintf " ]) || ([ "$nbintf" = "1" ] && [ -n "$uintf" ] && [ "$(ip r show $serverip metric 1 | grep $uintf)" = "" ]); then
|
||||
if [ -n "$routesintf" ] && ([ "$nbintf" -gt "1" ] && [ "$(ip r show $serverip metric 1 | tr -d '\t' | tr -d '\n' | sed 's/ *$//' | tr ' ' '\n' | sort | tr -d '\n')" != "$(echo $serverip $routesintf | sed 's/ *$//' | tr ' ' '\n' | sort | tr -d '\n')" ]) || ([ "$nbintf" = "1" ] && [ -n "$uintf" ] && [ "$(ip r show $serverip metric 1 | grep $uintf)" = "" ]); then
|
||||
while [ "$(ip r show $serverip | grep -v nexthop | sed 's/ //g' | tr -d '\n')" != "$serverip" ] && [ "$(ip r show $serverip | grep -v nexthop | sed 's/ //g' | tr -d '\n')" != "" ]; do
|
||||
ip r del $serverip
|
||||
done
|
||||
|
@ -426,7 +472,7 @@ set_server_all_routes() {
|
|||
ip route replace $serverip scope global metric 1 $routesintf 2>&1 >/dev/null
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "New server route is $(ip r show $serverip metric 1 | tr -d '\t' | tr -d '\n')"
|
||||
fi
|
||||
if [ -n "$routesintfbackup" ] && ([ "$nbintfb" -gt "1" ] && [ "$(ip r show $serverip metric 999 | tr -d '\t' | tr -d '\n')" != "$serverip $routesintfbackup " ]) || ([ "$nbintfb" = "1" ] && [ -n "$uintfb" ] && [ "$(ip r show $serverip metric 999 | grep $uintfb)" = "" ]); then
|
||||
if [ -n "$routesintfbackup" ] && ([ "$nbintfb" -gt "1" ] && [ "$(ip r show $serverip metric 999 | tr -d '\t' | tr -d '\n' | sed 's/ *$//' | tr ' ' '\n' | sort | tr -d '\n')" != "$(echo $serverip $routesintfbackup | sed 's/ *$//' | tr ' ' '\n' | sort | tr -d '\n')" ]) || ([ "$nbintfb" = "1" ] && [ -n "$uintfb" ] && [ "$(ip r show $serverip metric 999 | grep $uintfb)" = "" ]); then
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Set server $server ($serverip) backup default route $serverip $routesintfbackup nbintfb $nbintfb $OMR_TRACKER_DEVICE"
|
||||
ip route replace $serverip scope global metric 999 $routesintfbackup 2>&1 >/dev/null
|
||||
fi
|
||||
|
@ -437,16 +483,19 @@ set_server_all_routes() {
|
|||
|
||||
set_server_all_routes6() {
|
||||
local server=$1
|
||||
[ -z "$OMR_TRACKER_INTERFACE" ] && return
|
||||
server_route() {
|
||||
local serverip multipath_config_route
|
||||
serverip=$1
|
||||
[ -n "$serverip" ] && serverip="$(resolveip -6 -t 5 $serverip | head -n 1 | tr -d '\n')"
|
||||
config_get disabled $server disabled
|
||||
[ "$disabled" = "1" ] && return
|
||||
interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.ifname)
|
||||
network_get_device interface_if $OMR_TRACKER_INTERFACE
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${OMR_TRACKER_INTERFACE}_6" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$OMR_TRACKER_INTERFACE" | jsonfilter -q -e '@["device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.ifname)
|
||||
interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
multipath_config_route=$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipath || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" = "1" ] && {
|
||||
|
@ -462,7 +511,7 @@ set_server_all_routes6() {
|
|||
config_foreach set_routes_intf6 interface
|
||||
uintf="$(echo $routesintf6 | awk '{print $5}')"
|
||||
uintfb="$(echo $routesintfbackup6 | awk '{print $5}')"
|
||||
if [ -n "$routesintf6" ] && ([ "$nbintf6" -gt "1" ] && [ "$(ip -6 r show $serverip metric 1 | tr -d '\t' | tr -d '\n')" != "$serverip $routesintf6 " ]) || ([ "$nbintf6" = "1" ] && [ -n "$uintf" ] && [ "$(ip -6 r show $serverip metric 1 | grep $uintf)" = "" ]); then
|
||||
if [ -n "$routesintf6" ] && ([ "$nbintf6" -gt "1" ] && [ "$(ip -6 r show $serverip metric 1 | tr -d '\t' | sort | tr -d '\n' | sed 's/ *$//')" != "$(echo $serverip $routesintf6 | sort | sed 's/ *$//')" ]) || ([ "$nbintf6" = "1" ] && [ -n "$uintf" ] && [ "$(ip -6 r show $serverip metric 1 | grep $uintf)" = "" ]); then
|
||||
while [ "$(ip -6 r show $serverip | grep -v nexthop | sed 's/ //g' | tr -d '\n')" != "$serverip" ] && [ "$(ip -6 r show $serverip | grep -v nexthop | sed 's/ //g' | tr -d '\n')" != "" ]; do
|
||||
ip -6 r del $serverip
|
||||
done
|
||||
|
@ -483,6 +532,7 @@ set_server_all_routes6() {
|
|||
|
||||
set_server_route() {
|
||||
local server=$1
|
||||
[ -z "$OMR_TRACKER_INTERFACE" ] && return
|
||||
server_route() {
|
||||
local serverip multipath_config_route
|
||||
serverip=$1
|
||||
|
@ -497,10 +547,12 @@ set_server_route() {
|
|||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ] && multipath_config_route="$(uci -q get openmptcprouter.ovpn${OMR_TRACKER_INTERFACE}.multipath || echo "off")"
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "wireguard" ] && multipath_config_route="$(uci -q get openmptcprouter.wg${OMR_TRACKER_INTERFACE}.multipath || echo "off")"
|
||||
}
|
||||
interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.ifname)
|
||||
network_get_device interface_if $OMR_TRACKER_INTERFACE
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${OMR_TRACKER_INTERFACE}_4" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$OMR_TRACKER_INTERFACE" | jsonfilter -q -e '@["device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.ifname)
|
||||
interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
#multipath_current_config=$(multipath $interface_if | grep "deactivated")
|
||||
interface_current_config=$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.state || echo "up")
|
||||
|
@ -518,6 +570,7 @@ set_server_route() {
|
|||
|
||||
set_server_route6() {
|
||||
local server=$1
|
||||
[ -z "$OMR_TRACKER_INTERFACE" ] && return
|
||||
server_route() {
|
||||
local serverip multipath_config_route
|
||||
serverip=$1
|
||||
|
@ -532,10 +585,12 @@ set_server_route6() {
|
|||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ] && multipath_config_route="$(uci -q get openmptcprouter.ovpn${OMR_TRACKER_INTERFACE}.multipath || echo "off")"
|
||||
[ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "wireguard" ] && multipath_config_route="$(uci -q get openmptcprouter.wg${OMR_TRACKER_INTERFACE}.multipath || echo "off")"
|
||||
}
|
||||
interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.ifname)
|
||||
network_get_device interface_if $OMR_TRACKER_INTERFACE
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.device)
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${OMR_TRACKER_INTERFACE}_6" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$OMR_TRACKER_INTERFACE" | jsonfilter -q -e '@["device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$OMR_TRACKER_INTERFACE.ifname)
|
||||
interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
|
||||
#multipath_current_config=$(multipath $interface_if | grep "deactivated")
|
||||
interface_current_config=$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.state || echo "up")
|
||||
|
@ -556,9 +611,13 @@ del_server_route() {
|
|||
remove_route() {
|
||||
local serverip="$1"
|
||||
[ -n "$serverip" ] && serverip="$(resolveip -4 -t 5 $serverip | head -n 1 | tr -d '\n')"
|
||||
[ -n "$serverip" ] && _log "Delete default route via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE"
|
||||
[ -n "$serverip" ] && _log "Delete default route to $serverip via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE"
|
||||
local metric
|
||||
metric=$(uci -q get network.$OMR_TRACKER_INTERFACE.metric)
|
||||
if [ -z "$OMR_TRACKER_INTERFACE" ]; then
|
||||
metric=0
|
||||
else
|
||||
metric=$(uci -q get network.$OMR_TRACKER_INTERFACE.metric)
|
||||
fi
|
||||
[ -n "$metric" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ -n "$serverip" ] && [ -n "$(ip route show $serverip dev $OMR_TRACKER_DEVICE metric $metric)" ] && ip route del $serverip dev $OMR_TRACKER_DEVICE metric $metric >/dev/null 2>&1
|
||||
[ -n "$OMR_TRACKER_DEVICE" ] && [ -n "$serverip" ] && [ -n "$(ip route show $serverip dev $OMR_TRACKER_DEVICE)" ] && ip route del $serverip dev $OMR_TRACKER_DEVICE >/dev/null 2>&1
|
||||
[ -n "$OMR_TRACKER_DEVICE" ] && [ -n "$serverip" ] && [ -n "$(ip route show $serverip | grep $OMR_TRACKER_DEVICE)" ] && ip route del $serverip dev $OMR_TRACKER_DEVICE >/dev/null 2>&1
|
||||
|
@ -576,11 +635,15 @@ del_server_route6() {
|
|||
remove_route() {
|
||||
local serverip="$1"
|
||||
[ -n "$serverip" ] && serverip="$(resolveip -6 -t 5 $serverip | head -n 1 | tr -d '\n')"
|
||||
[ -n "$serverip" ] && _log "Delete default route via $OMR_TRACKER_DEVICE_GATEWAY6 dev $OMR_TRACKER_DEVICE"
|
||||
[ -n "$serverip" ] && _log "Delete default route to $serverip via $OMR_TRACKER_DEVICE_GATEWAY6 dev $OMR_TRACKER_DEVICE"
|
||||
local metric
|
||||
metric=$(uci -q get network.$OMR_TRACKER_INTERFACE.metric)
|
||||
[ -n "$OMR_TRACKER_DEVICE" ] && [ -n "$metric" ] && [ -n "$(ip -6 route show $serverip dev $OMR_TRACKER_DEVICE metric $metric)" ] && ip -6 route del $serverip dev $OMR_TRACKER_DEVICE metric $metric >/dev/null 2>&1
|
||||
[ -n "$OMR_TRACKER_DEVICE" ] && [ -n "$metric" ] && [ -n "$(ip -6 route show $serverip dev $OMR_TRACKER_DEVICE)" ] && ip -6 route del $serverip dev $OMR_TRACKER_DEVICE >/dev/null 2>&1
|
||||
if [ -z "$OMR_TRACKER_INTERFACE" ]; then
|
||||
metric=0
|
||||
else
|
||||
metric=$(uci -q get network.$OMR_TRACKER_INTERFACE.metric)
|
||||
fi
|
||||
[ -n "$OMR_TRACKER_DEVICE" ] && [ -n "$metric" ] && [ -n "$serverip"] && [ -n "$(ip -6 route show $serverip dev $OMR_TRACKER_DEVICE metric $metric)" ] && ip -6 route del $serverip dev $OMR_TRACKER_DEVICE metric $metric >/dev/null 2>&1
|
||||
[ -n "$OMR_TRACKER_DEVICE" ] && [ -n "$metric" ] && [ -n "$serverip" ] && [ -n "$(ip -6 route show $serverip dev $OMR_TRACKER_DEVICE)" ] && ip -6 route del $serverip dev $OMR_TRACKER_DEVICE >/dev/null 2>&1
|
||||
}
|
||||
config_list_foreach $server ip remove_route
|
||||
if [ -n "$OMR_TRACKER_DEVICE_GATEWAY6" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
|
||||
|
@ -608,7 +671,7 @@ disable_pihole() {
|
|||
enable_pihole() {
|
||||
local server=$1
|
||||
nbserver=$((nbserver+1))
|
||||
if [ "$(uci -q get openmptcprouter.${server}.pihole)" = "1" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server | grep '127.0.0.1#5353')" != "" ]; then
|
||||
if [ -n "$server" ] && [ "$(uci -q get openmptcprouter.${server}.pihole)" = "1" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server | grep '127.0.0.1#5353')" != "" ]; then
|
||||
piholeenabled=$((piholeenabled+1))
|
||||
fi
|
||||
}
|
||||
|
@ -643,20 +706,20 @@ interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e
|
|||
|
||||
# An interface in error will never be used in MPTCP
|
||||
if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
|
||||
if [ "$interface_up" = "true" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "wireguard" ]); then
|
||||
if [ "$interface_up" = "true" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "wireguard" ]); then
|
||||
_log "No answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart interface"
|
||||
_log "Set $OMR_TRACKER_INTERFACE down"
|
||||
ifdown $OMR_TRACKER_INTERFACE
|
||||
sleep 5
|
||||
_log "Set $OMR_TRACKER_INTERFACE up"
|
||||
ifup $OMR_TRACKER_INTERFACE
|
||||
sleep 10
|
||||
sleep 20
|
||||
fi
|
||||
|
||||
if [ "$OMR_TRACKER_PREV_STATUS" = "$OMR_TRACKER_STATUS" ]; then
|
||||
exit 0
|
||||
fi
|
||||
if [ "$multipath_status" != "off" ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" = "1" ]; then
|
||||
if [ "$multipath_status" != "off" ] || ([ -n "$OMR_TRACKER_INTERFACE" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" = "1" ]); then
|
||||
if [ "$OMR_TRACKER_STATUS_MSG" = "" ]; then
|
||||
_log "$OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) switched off"
|
||||
else
|
||||
|
@ -672,7 +735,7 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
|
|||
if [ -n "$OMR_TRACKER_DEVICE_IP6" ]; then
|
||||
glorytun-udp path addr $OMR_TRACKER_DEVICE_IP6 dev tun0 set down > /dev/null 2>&1
|
||||
fi
|
||||
if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ] && [ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ]; then
|
||||
if [ -n "$OMR_TRACKER_INTERFACE" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ] && [ "$(uci -q get openmptcprouter.settings.mptcpovervpn)" = "openvpn" ]; then
|
||||
VPN_BASE_INTF="$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.baseintf)"
|
||||
VPN_BASE_INTF_IP=$(ubus call network.interface.$VPN_BASE_INTF status | jsonfilter -e '@["ipv4-address"][0].address' | tr -d "\n")
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
|
@ -686,19 +749,25 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
|
|||
config_foreach del_server_route6 server
|
||||
#if [ "$(uci -q get openmptcprouter.settings.master)" = "balancing" ] && [ "$(uci -q get openmptcprouter.settings.vpn)" != "mlvpn" ]; then
|
||||
if [ "$(uci -q get openmptcprouter.settings.master)" = "balancing" ]; then
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Set balancing route (current: $(ip r) )"
|
||||
config_foreach set_server_all_routes server
|
||||
config_foreach set_server_all_routes6 server
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Set balancing route done (new: $(ip r) )"
|
||||
fi
|
||||
fi
|
||||
|
||||
if ([ "$default_gw" = "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ] || [ "$default_gw6" != "$OMR_TRACKER_DEVICE_GATEWAY6" ]) && [ "$(uci -q get openmptcprouter.settings.defaultgw)" != "0" ]; then
|
||||
config_load network
|
||||
config_foreach set_route interface $OMR_TRACKER_INTERFACE
|
||||
config_foreach set_route6 interface $OMR_TRACKER_INTERFACE
|
||||
elif [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.multipath)" = "master" ]; then
|
||||
config_load network
|
||||
config_foreach set_route interface $OMR_TRACKER_INTERFACE "no"
|
||||
config_foreach set_route6 interface $OMR_TRACKER_INTERFACE "no"
|
||||
if [ -n "$OMR_TRACKER_INTERFACE" ]; then
|
||||
if ([ "$default_gw" = "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ] || [ "$default_gw6" != "$OMR_TRACKER_DEVICE_GATEWAY6" ]) && [ "$(uci -q get openmptcprouter.settings.defaultgw)" != "0" ]; then
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Default gw: $default_gw - Set routes (current: $(ip r) )"
|
||||
config_load network
|
||||
config_foreach set_route interface $OMR_TRACKER_INTERFACE
|
||||
config_foreach set_route6 interface $OMR_TRACKER_INTERFACE
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "New routes $(ip r)"
|
||||
elif [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.multipath)" = "master" ]; then
|
||||
config_load network
|
||||
config_foreach set_route interface $OMR_TRACKER_INTERFACE "no"
|
||||
config_foreach set_route6 interface $OMR_TRACKER_INTERFACE "no"
|
||||
fi
|
||||
fi
|
||||
mail_alert="$(uci -q get omr-tracker.$OMR_TRACKER_INTERFACE.mail_alert)"
|
||||
[ -z "$mail_alert" ] && mail_alert="$(uci -q get omr-tracker.defaults.mail_alert)"
|
||||
|
@ -795,15 +864,17 @@ if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "om
|
|||
fi
|
||||
if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ]; then
|
||||
_log "Tunnel up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE"
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Current route: $(ip r)"
|
||||
ip route replace default scope global nexthop via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE 2>&1 >/dev/null
|
||||
if [ "$(pgrep openmptcprouter-vps)" = "" ]; then
|
||||
/etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1
|
||||
fi
|
||||
[ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "1" ] && conntrack -D -p udp 2>&1 >/dev/null
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "New route: $(ip r)"
|
||||
fi
|
||||
|
||||
# Set VPN MTU
|
||||
if [ -n "$OMR_TRACKER_LATENCY" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(date +"%s") - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc))) -gt 3600 ]); then
|
||||
if [ -n "$OMR_TRACKER_LATENCY" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(date +"%s") - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc))) -gt 3600 ]); then
|
||||
local serverip=$(uci -q get shadowsocks-libev.sss0.server)
|
||||
[ -n "$serverip" ] && serverip="$(resolveip -4 -t 5 $serverip | head -n 1 | tr -d '\n')"
|
||||
if [ "$serverip" = "192.168.1.3" ] || [ "$serverip" = "127.0.0.1" ]; then
|
||||
|
@ -812,17 +883,18 @@ if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "om
|
|||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE="interface"
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.latency="$OMR_TRACKER_LATENCY"
|
||||
if [ "$(uci -q get glorytun.vpn.enable)" != "1" ] || [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ]; then
|
||||
if [ -n "$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
|
||||
mtu=$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
||||
OMR_NETWORK_DEVICE=$(find_network_device ${OMR_TRACKER_INTERFACE})
|
||||
if [ -n "$OMR_NETWORK_DEVICE" ] && [ -n "$(uci -q get network.$OMR_NETWORK_DEVICE.mtu)" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
|
||||
mtu=$(uci -q get network.$OMR_NETWORK_DEVICE.mtu)
|
||||
uci -q set openmptcprouter.${OMR_TRACKER_INTERFACE}.mtu=$mtu
|
||||
[ -n "$mtu" ] && ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s")
|
||||
elif [ -z "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.mtu)" ] && [ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
|
||||
elif [ -z "$(uci -q get openmptcprouter.${OMR_TRACKER_INTERFACE}.mtu)" ] && [ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
|
||||
if [ -n "$serverip" ] && [ "$serverip" != "127.0.0.1" ]; then
|
||||
local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP $serverip)
|
||||
#local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP 8.8.8.8)
|
||||
[ -n "$mtu" ] && {
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
||||
uci -q set openmptcprouter.${OMR_TRACKER_INTERFACE}.mtu=$mtu
|
||||
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s")
|
||||
}
|
||||
|
@ -895,8 +967,9 @@ multipath_config=$(uci -q get "openmtpcprouter.$OMR_TRACKER_INTERFACE.multipath"
|
|||
if [ "$multipath_config" = "master" ]; then
|
||||
#if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ] && ([ "$(uci -q get openmptcprouter.settings.master)" != "balancing" ] || [ "$(uci -q get openmptcprouter.settings.vpn)" = "mlvpn" ]); then
|
||||
if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ] && [ "$(uci -q get openmptcprouter.settings.master)" != "balancing" ]; then
|
||||
omrvpn_intf=$(uci -q get "network.omrvpn.ifname" || echo "tun")
|
||||
if [ -n "$omrvpn_intf" ] && [ "$(ip route show default | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ] && [ "$(uci -q get openmptcprouter.settings.defaultgw)" != "0" ]; then
|
||||
omrvpn_intf=$(uci -q get "network.omrvpn.device" || echo "tun0")
|
||||
[ -z "$omrvpn_intf" ] && omrvpn_intf=$(uci -q get "network.omrvpn.ifname" || echo "tun0")
|
||||
if [ -n "$omrvpn_intf" ] && [ "$(ip route show default | grep -v metric | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ] && [ "$(uci -q get openmptcprouter.settings.defaultgw)" != "0" ]; then
|
||||
_log "Master up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE"
|
||||
ip route replace default scope global nexthop via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE 2>&1 >/dev/null
|
||||
fi
|
||||
|
@ -908,7 +981,8 @@ if [ "$multipath_config" = "master" ]; then
|
|||
fi
|
||||
fi
|
||||
if ([ "$default_gw6" != "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$default_gw6" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY6" != "" ] && [ "$(uci -q get openmptcprouter.settings.master)" != "balancing" ]; then
|
||||
omrvpn_intf=$(uci -q get "network.omrvpn.ifname" || echo "tun")
|
||||
omrvpn_intf=$(uci -q get "network.omrvpn.device" || echo "tun0")
|
||||
[ -z "$omrvpn_intf" ] && omrvpn_intf=$(uci -q get "network.omrvpn.ifname" || echo "tun0")
|
||||
if [ -n "$omrvpn_intf" ] && [ "$(ip route show default | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ] && [ "$(uci -q get openmptcprouter.settings.defaultgw)" != "0" ]; then
|
||||
_log "Master up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY6 dev $OMR_TRACKER_DEVICE"
|
||||
ip -6 route replace default scope global nexthop via $OMR_TRACKER_DEVICE_GATEWAY6 dev $OMR_TRACKER_DEVICE 2>&1 >/dev/null
|
||||
|
@ -923,8 +997,9 @@ if [ "$multipath_config" = "master" ]; then
|
|||
fi
|
||||
#if [ "$(uci -q get openmptcprouter.settings.master)" = "balancing" ] && [ "$(ip route show default | grep weight)" = "" ] && [ "$(uci -q get openmptcprouter.settings.defaultgw)" != "0" ] && [ "$(uci -q get openmptcprouter.settings.vpn)" != "mlvpn" ]; then
|
||||
if [ "$(uci -q get openmptcprouter.settings.master)" = "balancing" ] && [ "$(ip route show default | grep weight)" = "" ] && [ "$(uci -q get openmptcprouter.settings.defaultgw)" != "0" ]; then
|
||||
omrvpn_intf=$(uci -q get "network.omrvpn.ifname" || echo "tun")
|
||||
if [ -n "$omrvpn_intf" ] && [ "$(ip route show default | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ]; then
|
||||
omrvpn_intf=$(uci -q get "network.omrvpn.device" || echo "tun0")
|
||||
[ -z "$omrvpn_intf" ] && omrvpn_intf=$(uci -q get "network.omrvpn.ifname" || echo "tun0")
|
||||
if [ -n "$omrvpn_intf" ] && [ "$(ip route show default | grep -v metric | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ]; then
|
||||
routesbalancing=""
|
||||
routesbalancingbackup=""
|
||||
nbintf=0
|
||||
|
@ -936,8 +1011,10 @@ if [ "$multipath_config" = "master" ]; then
|
|||
config_foreach set_route_balancing6 interface
|
||||
[ -n "$routesbalancing" ] && {
|
||||
([ "$nbintf" -gt "1" ] && [ "$(ip r show default metric 1 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancing " ]) || ([ "$nbintf" = "1" ] && ([ "$(ip r show default metric 1 | grep $OMR_TRACKER_DEVICE)" = "" ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ]) && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
_log "Set ip route replace default scope global $routesbalancing"
|
||||
_log "Change in routes, set ip route replace default scope global $routesbalancing (omrvpn_intf: $omrvpn_intf)"
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Current route: $(ip r)"
|
||||
ip route replace default scope global metric 1 $routesbalancing 2>&1 >/dev/null
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "New route: $(ip r)"
|
||||
}
|
||||
}
|
||||
[ -n "$routesbalancing6" ] && {
|
||||
|
@ -948,7 +1025,7 @@ if [ "$multipath_config" = "master" ]; then
|
|||
}
|
||||
[ -n "$routesbalancingbackup" ] && {
|
||||
([ "$nbintfb" -gt "1" ] && [ "$(ip r show default metric 999 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancingbackup " ]) || ([ "$nbintf" = "1" ] && ([ "$(ip r show default metric 999 | grep $OMR_TRACKER_DEVICE)" = "" ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ]) && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
_log "Set backup ip route replace default scope global $routesbalancingbackup"
|
||||
_log "Set backup ip route replace default scope global metric 999 $routesbalancingbackup"
|
||||
ip route replace default scope global metric 999 $routesbalancingbackup 2>&1 >/dev/null
|
||||
}
|
||||
}
|
||||
|
@ -981,7 +1058,8 @@ if [ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY" ]; then
|
|||
config_foreach set_server_route server
|
||||
fi
|
||||
if [ -n "$OMR_TRACKER_DEVICE_GATEWAY" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ "$(ip r show dev $OMR_TRACKER_DEVICE | grep default)" = "" ] && [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.metric)" != "" ]; then
|
||||
ip r replace default via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE metric $(uci -q get network.$OMR_TRACKER_INTERFACE.metric) >/dev/null 2>&1
|
||||
_log "Interface route not yet set, set route ip r add default via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE metric $(uci -q get network.$OMR_TRACKER_INTERFACE.metric)"
|
||||
ip r add default via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE metric $(uci -q get network.$OMR_TRACKER_INTERFACE.metric) >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$OMR_TRACKER_DEVICE_IP6" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then
|
||||
|
@ -1012,7 +1090,7 @@ if [ "$multipath_config" = "on" ] || [ "$multipath_config" = "backup" ]; then
|
|||
serverip=$1
|
||||
#gtudpst="up"
|
||||
#[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && [ "$multipath_config" = "backup" ] && [ "$(pgrep glorytun-udp)" != "" ] && gtudpst="backup"
|
||||
if [ "$OMR_TRACKER_DEVICE_IP" != "" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ] && [ "$(pgrep glorytun-udp)" != "" ] && [ "$(glorytun-udp path | grep $OMR_TRACKER_DEVICE_IP)" = "" ] && [ -n "$(resolveip -4 $serverip)" ]; then
|
||||
if [ "$OMR_TRACKER_DEVICE_IP" != "" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ] && [ "$(pgrep glorytun-udp)" != "" ] && [ "$(glorytun-udp path | grep $OMR_TRACKER_DEVICE_IP | grep running)" = "" ] && [ -n "$(resolveip -4 $serverip)" ]; then
|
||||
if [ "$download" != "0" ] && [ "$download" != "" ] && [ "$upload" != "0" ] && [ "$upload" != "" ]; then
|
||||
if [ "$(uci -q get glorytun-udp.vpn.rateauto)" = "1" ]; then
|
||||
glorytun-udp path addr $OMR_TRACKER_DEVICE_IP to addr $serverip port ${gtudp_port} dev ${gtudp_dev} set up rate auto tx $((upload*1000/8)) rx $((download*1000/8)) pref 1 > /dev/null 2>&1
|
||||
|
@ -1027,7 +1105,7 @@ if [ "$multipath_config" = "on" ] || [ "$multipath_config" = "backup" ]; then
|
|||
fi
|
||||
fi
|
||||
fi
|
||||
if [ "$OMR_TRACKER_DEVICE_IP6" != "" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ] && [ "$(pgrep glorytun-udp)" != "" ] && [ "$(glorytun-udp path | grep $OMR_TRACKER_DEVICE_IP6)" = "" ] && [ -n "$(resolveip -6 $serverip)" ]; then
|
||||
if [ "$OMR_TRACKER_DEVICE_IP6" != "" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ] && [ "$(pgrep glorytun-udp)" != "" ] && [ "$(glorytun-udp path | grep $OMR_TRACKER_DEVICE_IP6 | grep running)" = "" ] && [ -n "$(resolveip -6 $serverip)" ]; then
|
||||
if [ "$download" != "0" ] && [ "$download" != "" ] && [ "$upload" != "0" ] && [ "$upload" != "" ]; then
|
||||
if [ "$(uci -q get glorytun-udp.vpn.rateauto)" = "1" ]; then
|
||||
glorytun-udp path addr $OMR_TRACKER_DEVICE_IP6 to addr $serverip port ${gtudp_port} dev ${gtudp_dev} set up rate auto tx $((upload*1000/8)) rx $((download*1000/8)) pref 1 > /dev/null 2>&1
|
||||
|
@ -1057,7 +1135,7 @@ if [ "$multipath_config" = "on" ] || [ "$multipath_config" = "backup" ]; then
|
|||
fi
|
||||
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && {
|
||||
[ "$multipath_status" = "$multipath_config" ] || {
|
||||
if [ "$(sysctl -n net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ]; then
|
||||
if [ "$(sysctl -qen net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ] || [ "$(sysctl -qen net.mptcp.enabled | tr -d '\n')" = "1" ]; then
|
||||
_log "Multipath $OMR_TRACKER_DEVICE switched to $multipath_config"
|
||||
multipath "$OMR_TRACKER_DEVICE" "$multipath_config"
|
||||
fi
|
||||
|
@ -1083,7 +1161,7 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
|
|||
#[ -z "$check_ipv6_website" ] && check_ipv6_website="http://ipv6.openmptcprouter.com/"
|
||||
#local ip6addr="$(curl -s -6 -m 2 $check_ipv6_website)"
|
||||
#[ -z "$ip6addr" ] && {
|
||||
# local ip6addr="$(curl -s -6 -m 2 http://ifconfig.co/)"
|
||||
# local ip6addr="$(curl -s -6 -m 2 http://ifconfig.me/)"
|
||||
#}
|
||||
#if [ "$(uci -q get openmptcprouter.settings.ipv6_disable)" = "0" ]; then
|
||||
# if [ -n "$ip6addr" ] && [ "$(uci -q get dhcp.lan.ra_default)" != 1 ]; then
|
||||
|
@ -1104,7 +1182,7 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
|
|||
if [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ]; then
|
||||
#local asn="$(wget -4 -qO- -T 4 http://api.iptoasn.com/v1/as/ip/$ipaddr | jsonfilter -q -e '@.as_description')"
|
||||
#[ -z "$asn" ] && {
|
||||
local asn="$(whois $ipaddr 2>/dev/null | grep -m 1 -i 'netname' | awk '{print $2}')"
|
||||
local asn="$(timeout 2 whois $ipaddr 2>/dev/null | grep -m 1 -i 'netname' | awk '{print $2}')"
|
||||
#}
|
||||
fi
|
||||
[ -z "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE)" ] && {
|
||||
|
@ -1119,9 +1197,16 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
|
|||
uci -q set openmptcprouter.latest_versions.lc=$(date +"%s")
|
||||
}
|
||||
fi
|
||||
[ -n "$ipaddr" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.publicip="$ipaddr"
|
||||
[ -n "$ipaddr" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.publicip)" != "$ipaddr" ] && {
|
||||
_log "New public ip detected for $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE): $ipaddr"
|
||||
/etc/init.d/mptcp enabled && {
|
||||
_log "Reload MPTCP for $OMR_TRACKER_DEVICE"
|
||||
/etc/init.d/mptcp reload "$OMR_TRACKER_DEVICE" >/dev/null
|
||||
}
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.publicip="$ipaddr"
|
||||
}
|
||||
[ -n "$OMR_TRACKER_LATENCY" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.latency="$OMR_TRACKER_LATENCY"
|
||||
[ -n "$asn" ] && {
|
||||
[ -n "$asn" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.asn)" != "$asn" ] && {
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.asn="$asn"
|
||||
}
|
||||
|
||||
|
@ -1163,8 +1248,8 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
|
|||
[ -n "$omrtracebox" ] && [ -z "$(echo $omrtracebox | grep error)" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$omrtracebox"
|
||||
}
|
||||
if [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" != "1" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
|
||||
if [ -n "$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)" ]; then
|
||||
mtu=$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)
|
||||
if [ -n "$(uci -q get network.$(find_network_device ${OMR_TRACKER_INTERFACE}).mtu)" ]; then
|
||||
mtu=$(uci -q get network.$(find_network_device ${OMR_TRACKER_INTERFACE}).mtu)
|
||||
[ -n "$mtu" ] && {
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
||||
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
||||
|
@ -1213,7 +1298,14 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
|
|||
uci -q set openmptcprouter.latest_versions.lc=$(date +"%s")
|
||||
}
|
||||
fi
|
||||
[ -n "$ipaddr" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.publicip6="$ip6addr"
|
||||
[ -n "$ip6addr" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.publicip)" != "$ip6addr" ] && {
|
||||
_log "New public ip detected for $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE): $ip6addr"
|
||||
/etc/init.d/mptcp enabled && {
|
||||
_log "Reload MPTCP for $OMR_TRACKER_DEVICE"
|
||||
/etc/init.d/mptcp reload "$OMR_TRACKER_DEVICE" >/dev/null
|
||||
}
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.publicip="$ip6addr"
|
||||
}
|
||||
[ -n "$OMR_TRACKER_LATENCY" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.latency="$OMR_TRACKER_LATENCY"
|
||||
[ -n "$asn" ] && {
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.asn="$asn"
|
||||
|
@ -1227,10 +1319,10 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
|
|||
[ -n "$omrtracebox" ] && [ -z "$(echo $omrtracebox | grep error)" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$omrtracebox"
|
||||
}
|
||||
if [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" != "1" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
|
||||
if [ -n "$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)" ]; then
|
||||
mtu=$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)
|
||||
if [ -n "$(uci -q get network.$(find_network_device ${OMR_TRACKER_INTERFACE}).mtu)" ]; then
|
||||
mtu=$(uci -q get network.$(find_network_device ${OMR_TRACKER_INTERFACE}).mtu)
|
||||
[ -n "$mtu" ] && {
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
||||
uci -q set openmptcprouter.${OMR_TRACKER_INTERFACE}.mtu=$mtu
|
||||
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
||||
}
|
||||
elif [ -n "$OMR_TRACKER_DEVICE_IP" ]; then
|
||||
|
@ -1395,6 +1487,12 @@ if [ "$(pgrep rpcd)" = "" ] && [ -f /etc/init.d/rpcd ]; then
|
|||
sleep 5
|
||||
fi
|
||||
|
||||
if [ "$(pgrep uhttpd)" = "" ] && [ -f /etc/init.d/uhttpd ]; then
|
||||
_log "Can't find uhttpd, restart it..."
|
||||
/etc/init.d/uhttpd restart
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
#if [ "$(pgrep ModemManager)" = "" ] && [ -f /etc/init.d/modemmanager ] && [ -n "$(uci -q show network | grep modemmanager)" ] && [ "$(uci -q get openmptcprouter.settings.modemmanager)" != "0" ]; then
|
||||
# _log "Can't find ModemManager, restart it..."
|
||||
# /etc/init.d/modemmanager restart
|
||||
|
@ -1456,7 +1554,8 @@ if [ "$(pgrep openmptcprouter-vps)" = "" ] && ([ "$(uci -q show openmptcprouter
|
|||
sleep 5
|
||||
fi
|
||||
|
||||
if [ "$(pgrep openmptcprouter-vps)" = "" ] && ([ "$(uci -q show openmptcprouter | grep set_firewall=\'1\')" != "" ] || [ -z "$(iptables-save | grep omr_dst_bypass_${OMR_TRACKER_DEVICE})" ]); then
|
||||
|
||||
if [ "$(uci -q show openmptcprouter | grep server)" != "" ] && [ "$(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
|
||||
_log "Set firewall on server"
|
||||
/etc/init.d/openmptcprouter-vps set_vps_firewall >/dev/null 2>&1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue