From 5c2607bd1447f014ffce9ab1b387591c1ea6e755 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 27 Nov 2019 20:10:50 +0100 Subject: [PATCH] Restart all only if needed --- .../luasrc/controller/openmptcprouter.lua | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 9f0e31558..7c5e557bc 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -568,23 +568,23 @@ function wizard_add() ucic:commit("openmptcprouter") -- Restart all - luci.sys.call("(env -i /bin/ubus call network reload) >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/mptcp restart >/dev/null 2>/dev/null") - if openmptcprouter_vps_key ~= "" then - luci.sys.call("/etc/init.d/openmptcprouter-vps restart >/dev/null 2>/dev/null") - os.execute("sleep 2") - end - luci.sys.call("/etc/init.d/shadowsocks-libev restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/glorytun restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/glorytun-udp restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/mlvpn restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/ubond restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/openvpn restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/dsvpn restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/omr-tracker restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/omr-6in4 restart >/dev/null 2>/dev/null") - luci.sys.call("/etc/init.d/vnstat restart >/dev/null 2>/dev/null") if gostatus == true then + luci.sys.call("(env -i /bin/ubus call network reload) >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/mptcp restart >/dev/null 2>/dev/null") + if openmptcprouter_vps_key ~= "" then + luci.sys.call("/etc/init.d/openmptcprouter-vps restart >/dev/null 2>/dev/null") + os.execute("sleep 2") + end + luci.sys.call("/etc/init.d/shadowsocks-libev restart >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/glorytun restart >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/glorytun-udp restart >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/mlvpn restart >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/ubond restart >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/openvpn restart >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/dsvpn restart >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/omr-tracker restart >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/omr-6in4 restart >/dev/null 2>/dev/null") + luci.sys.call("/etc/init.d/vnstat restart >/dev/null 2>/dev/null") luci.http.redirect(luci.dispatcher.build_url("admin/system/openmptcprouter/status")) else luci.http.redirect(luci.dispatcher.build_url("admin/system/openmptcprouter/wizard"))