From 5ca8b0227d55544512c4e5acf01036ea742f1fb8 Mon Sep 17 00:00:00 2001 From: Jeroen Louwes Date: Tue, 20 Oct 2015 10:04:20 +0200 Subject: [PATCH] mwan3: update to version 1.6-3 Fix for changed location ip binary Signed-off-by: Jeroen Louwes --- net/mwan3/Makefile | 2 +- net/mwan3/files/etc/hotplug.d/iface/15-mwan3 | 55 +++++++++++++------- net/mwan3/files/usr/sbin/mwan3 | 25 +++++++-- 3 files changed, 58 insertions(+), 24 deletions(-) diff --git a/net/mwan3/Makefile b/net/mwan3/Makefile index 97511b9985..bcf56f05ef 100644 --- a/net/mwan3/Makefile +++ b/net/mwan3/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwan3 PKG_VERSION:=1.6 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_MAINTAINER:=Jeroen Louwes PKG_LICENSE:=GPLv2 diff --git a/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 b/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 index f117e49e6b..12423c794f 100644 --- a/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 +++ b/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 @@ -1,5 +1,41 @@ #!/bin/sh +local IP IPS IPT LOG + +[ -n "$ACTION" ] || exit 0 +[ -n "$INTERFACE" ] || exit 0 + +if [ $ACTION == "ifup" ]; then + [ -n "$DEVICE" ] || exit 0 +fi + +if [ -x /usr/sbin/ip ]; then + IP="/usr/sbin/ip -4" +elif [ -x /usr/bin/ip ]; then + IP="/usr/bin/ip -4" +else + exit 1 +fi + +if [ -x /usr/sbin/ipset ]; then + IPS="/usr/sbin/ipset" +else + exit 1 +fi + +if [ -x /usr/sbin/iptables ]; then + IPT="/usr/sbin/iptables -t mangle -w" +else + exit 1 +fi + +if [ -x /usr/bin/logger ]; then + LOG="/usr/bin/logger -t mwan3 -p" +else + exit 1 +fi + + mwan3_get_iface_id() { let iface_count++ @@ -398,25 +434,6 @@ mwan3_ifupdown() config_foreach mwan3_set_user_rules_iptables rule } -[ -n "$ACTION" ] || exit 0 -[ -n "$INTERFACE" ] || exit 0 - -if [ $ACTION == "ifup" ]; then - [ -n "$DEVICE" ] || exit 0 -fi - -[ -x /usr/sbin/ip ] || exit 1 -[ -x /usr/sbin/ipset ] || exit 1 -[ -x /usr/sbin/iptables ] || exit 1 -[ -x /usr/bin/logger ] || exit 1 - -local IP IPS IPT LOG - -IP="/usr/sbin/ip -4" -IPS="/usr/sbin/ipset" -IPT="/usr/sbin/iptables -t mangle -w" -LOG="/usr/bin/logger -t mwan3 -p" - case "$ACTION" in ifup|ifdown) mwan3_ifupdown diff --git a/net/mwan3/files/usr/sbin/mwan3 b/net/mwan3/files/usr/sbin/mwan3 index b887fa5e6b..a5da22ac9f 100755 --- a/net/mwan3/files/usr/sbin/mwan3 +++ b/net/mwan3/files/usr/sbin/mwan3 @@ -1,9 +1,26 @@ #!/bin/sh -. /lib/functions.sh -IP="/usr/sbin/ip -4" -IPS="/usr/sbin/ipset" -IPT="/usr/sbin/iptables -t mangle -w" +if [ -x /usr/sbin/ip ]; then + IP="/usr/sbin/ip -4" +elif [ -x /usr/bin/ip ]; then + IP="/usr/bin/ip -4" +else + exit 1 +fi + +if [ -x /usr/sbin/ipset ]; then + IPS="/usr/sbin/ipset" +else + exit 1 +fi + +if [ -x /usr/sbin/iptables ]; then + IPT="/usr/sbin/iptables -t mangle -w" +else + exit 1 +fi + +. /lib/functions.sh help() { -- 2.30.2