This propagates the exit code of the command wrapped by `mwan3 use` and
allows for example to use `mwan3 use` in monitoring scripts.
Before change:
shell command:
mwan3 use wan false >/dev/null && echo ok || echo fail
result:
ok
After change:
shell command:
mwan3 use wan false >/dev/null && echo ok || echo fail
result:
fail
Signed-off-by: Philipp Schmitt <philipp@schmitt.co>
include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
-PKG_VERSION:=2.11.17
+PKG_VERSION:=2.11.18
PKG_RELEASE:=5
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>, \
Aaron Goodman <aaronjg@alumni.stanford.edu>
}
case "$1" in
- ifup|ifdown|interfaces|policies|connected|rules|status|start|stop|restart|use|internal)
+ ifup|ifdown|interfaces|policies|connected|rules|status|start|stop|restart|internal)
mwan3_init
"$@"
;;
+ use)
+ mwan3_init
+ "$@"
+ # Propagate mwan3 use command exit code
+ exit "$?"
+ ;;
*)
help
;;