From 22847e49867f5ff40d02b831a7bec9bbcfc962ba Mon Sep 17 00:00:00 2001
From: Jan-Tarek Butt <tarek@ring0.de>
Date: Sat, 11 Apr 2020 21:15:40 +0200
Subject: [PATCH] gluon-reload: add missing service restarts on domain
 switching

[Matthias Schiffer: fix up start/stop order and file permissions]
---
 package/gluon-alfred/files/lib/gluon/reload.d/301-alfred-stop   | 2 ++
 package/gluon-alfred/files/lib/gluon/reload.d/799-alfred-start  | 2 ++
 package/gluon-core/files/lib/gluon/reload.d/302-sysntpd-stop    | 2 ++
 package/gluon-core/files/lib/gluon/reload.d/380-network-stop    | 2 ++
 package/gluon-core/files/lib/gluon/reload.d/381-dnsmasq-stop    | 2 ++
 package/gluon-core/files/lib/gluon/reload.d/381-firewall-stop   | 2 ++
 package/gluon-core/files/lib/gluon/reload.d/500-core            | 2 --
 package/gluon-core/files/lib/gluon/reload.d/719-dnsmasq-start   | 2 ++
 package/gluon-core/files/lib/gluon/reload.d/719-firewall-start  | 2 ++
 package/gluon-core/files/lib/gluon/reload.d/720-network-start   | 2 ++
 package/gluon-core/files/lib/gluon/reload.d/798-sysntpd-start   | 2 ++
 .../files/lib/gluon/reload.d/380-gluon-arp-limiter-stop         | 2 ++
 .../files/lib/gluon/reload.d/720-gluon-arp-limiter-start        | 2 ++
 .../files/lib/gluon/reload.d/381-gluon-ebtables-stop            | 2 ++
 .../files/lib/gluon/reload.d/719-gluon-ebtables-start           | 2 ++
 .../gluon/reload.d/{200-mesh-vpn-fastd-stop => 305-fastd-stop}  | 0
 .../reload.d/{800-mesh-vpn-fastd-start => 795-fastd-start}      | 0
 .../{200-mesh-vpn-tunneldigger-stop => 310-tunneldigger-stop}   | 0
 .../{800-mesh-vpn-tunneldigger-start => 790-tunneldigger-start} | 0
 .../files/lib/gluon/reload.d/350-gluon-radv-filterd-stop        | 2 ++
 .../files/lib/gluon/reload.d/750-gluon-radv-filterd-start       | 2 ++
 .../gluon-radvd/files/lib/gluon/reload.d/350-gluon-radvd-stop   | 2 ++
 .../gluon-radvd/files/lib/gluon/reload.d/750-gluon-radvd-start  | 2 ++
 .../reload.d/{100-respondd-stop => 350-gluon-respondd-stop}     | 0
 .../reload.d/{900-respondd-start => 750-gluon-respondd-start}   | 0
 .../files/lib/gluon/reload.d/340-gluon-wan-dnsmasq-stop         | 2 ++
 .../files/lib/gluon/reload.d/760-gluon-wan-dnsmasq-start        | 2 ++
 27 files changed, 40 insertions(+), 2 deletions(-)
 create mode 100755 package/gluon-alfred/files/lib/gluon/reload.d/301-alfred-stop
 create mode 100755 package/gluon-alfred/files/lib/gluon/reload.d/799-alfred-start
 create mode 100755 package/gluon-core/files/lib/gluon/reload.d/302-sysntpd-stop
 create mode 100755 package/gluon-core/files/lib/gluon/reload.d/380-network-stop
 create mode 100755 package/gluon-core/files/lib/gluon/reload.d/381-dnsmasq-stop
 create mode 100755 package/gluon-core/files/lib/gluon/reload.d/381-firewall-stop
 delete mode 100755 package/gluon-core/files/lib/gluon/reload.d/500-core
 create mode 100755 package/gluon-core/files/lib/gluon/reload.d/719-dnsmasq-start
 create mode 100755 package/gluon-core/files/lib/gluon/reload.d/719-firewall-start
 create mode 100755 package/gluon-core/files/lib/gluon/reload.d/720-network-start
 create mode 100755 package/gluon-core/files/lib/gluon/reload.d/798-sysntpd-start
 create mode 100755 package/gluon-ebtables-limit-arp/files/lib/gluon/reload.d/380-gluon-arp-limiter-stop
 create mode 100755 package/gluon-ebtables-limit-arp/files/lib/gluon/reload.d/720-gluon-arp-limiter-start
 create mode 100755 package/gluon-ebtables/files/lib/gluon/reload.d/381-gluon-ebtables-stop
 create mode 100755 package/gluon-ebtables/files/lib/gluon/reload.d/719-gluon-ebtables-start
 rename package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/{200-mesh-vpn-fastd-stop => 305-fastd-stop} (100%)
 rename package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/{800-mesh-vpn-fastd-start => 795-fastd-start} (100%)
 rename package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/{200-mesh-vpn-tunneldigger-stop => 310-tunneldigger-stop} (100%)
 rename package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/{800-mesh-vpn-tunneldigger-start => 790-tunneldigger-start} (100%)
 create mode 100755 package/gluon-radv-filterd/files/lib/gluon/reload.d/350-gluon-radv-filterd-stop
 create mode 100755 package/gluon-radv-filterd/files/lib/gluon/reload.d/750-gluon-radv-filterd-start
 create mode 100755 package/gluon-radvd/files/lib/gluon/reload.d/350-gluon-radvd-stop
 create mode 100755 package/gluon-radvd/files/lib/gluon/reload.d/750-gluon-radvd-start
 rename package/gluon-respondd/files/lib/gluon/reload.d/{100-respondd-stop => 350-gluon-respondd-stop} (100%)
 rename package/gluon-respondd/files/lib/gluon/reload.d/{900-respondd-start => 750-gluon-respondd-start} (100%)
 create mode 100755 package/gluon-wan-dnsmasq/files/lib/gluon/reload.d/340-gluon-wan-dnsmasq-stop
 create mode 100755 package/gluon-wan-dnsmasq/files/lib/gluon/reload.d/760-gluon-wan-dnsmasq-start

diff --git a/package/gluon-alfred/files/lib/gluon/reload.d/301-alfred-stop b/package/gluon-alfred/files/lib/gluon/reload.d/301-alfred-stop
new file mode 100755
index 000000000..2b7170f3a
--- /dev/null
+++ b/package/gluon-alfred/files/lib/gluon/reload.d/301-alfred-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/alfred stop
diff --git a/package/gluon-alfred/files/lib/gluon/reload.d/799-alfred-start b/package/gluon-alfred/files/lib/gluon/reload.d/799-alfred-start
new file mode 100755
index 000000000..fefe91cce
--- /dev/null
+++ b/package/gluon-alfred/files/lib/gluon/reload.d/799-alfred-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/alfred start
diff --git a/package/gluon-core/files/lib/gluon/reload.d/302-sysntpd-stop b/package/gluon-core/files/lib/gluon/reload.d/302-sysntpd-stop
new file mode 100755
index 000000000..0c0dc37d0
--- /dev/null
+++ b/package/gluon-core/files/lib/gluon/reload.d/302-sysntpd-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/sysntpd stop
diff --git a/package/gluon-core/files/lib/gluon/reload.d/380-network-stop b/package/gluon-core/files/lib/gluon/reload.d/380-network-stop
new file mode 100755
index 000000000..eba67305f
--- /dev/null
+++ b/package/gluon-core/files/lib/gluon/reload.d/380-network-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/network stop
diff --git a/package/gluon-core/files/lib/gluon/reload.d/381-dnsmasq-stop b/package/gluon-core/files/lib/gluon/reload.d/381-dnsmasq-stop
new file mode 100755
index 000000000..e54847168
--- /dev/null
+++ b/package/gluon-core/files/lib/gluon/reload.d/381-dnsmasq-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/dnsmasq stop
diff --git a/package/gluon-core/files/lib/gluon/reload.d/381-firewall-stop b/package/gluon-core/files/lib/gluon/reload.d/381-firewall-stop
new file mode 100755
index 000000000..dbbfe6bcb
--- /dev/null
+++ b/package/gluon-core/files/lib/gluon/reload.d/381-firewall-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/firewall stop
diff --git a/package/gluon-core/files/lib/gluon/reload.d/500-core b/package/gluon-core/files/lib/gluon/reload.d/500-core
deleted file mode 100755
index bc8640877..000000000
--- a/package/gluon-core/files/lib/gluon/reload.d/500-core
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-/etc/init.d/network restart
diff --git a/package/gluon-core/files/lib/gluon/reload.d/719-dnsmasq-start b/package/gluon-core/files/lib/gluon/reload.d/719-dnsmasq-start
new file mode 100755
index 000000000..10becb4ed
--- /dev/null
+++ b/package/gluon-core/files/lib/gluon/reload.d/719-dnsmasq-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/dnsmasq start
diff --git a/package/gluon-core/files/lib/gluon/reload.d/719-firewall-start b/package/gluon-core/files/lib/gluon/reload.d/719-firewall-start
new file mode 100755
index 000000000..a610a932e
--- /dev/null
+++ b/package/gluon-core/files/lib/gluon/reload.d/719-firewall-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/firewall start
diff --git a/package/gluon-core/files/lib/gluon/reload.d/720-network-start b/package/gluon-core/files/lib/gluon/reload.d/720-network-start
new file mode 100755
index 000000000..e4b66eb2a
--- /dev/null
+++ b/package/gluon-core/files/lib/gluon/reload.d/720-network-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/network start
diff --git a/package/gluon-core/files/lib/gluon/reload.d/798-sysntpd-start b/package/gluon-core/files/lib/gluon/reload.d/798-sysntpd-start
new file mode 100755
index 000000000..78b63a748
--- /dev/null
+++ b/package/gluon-core/files/lib/gluon/reload.d/798-sysntpd-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/sysntpd start
diff --git a/package/gluon-ebtables-limit-arp/files/lib/gluon/reload.d/380-gluon-arp-limiter-stop b/package/gluon-ebtables-limit-arp/files/lib/gluon/reload.d/380-gluon-arp-limiter-stop
new file mode 100755
index 000000000..c8b5aa2cb
--- /dev/null
+++ b/package/gluon-ebtables-limit-arp/files/lib/gluon/reload.d/380-gluon-arp-limiter-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-arp-limiter stop
diff --git a/package/gluon-ebtables-limit-arp/files/lib/gluon/reload.d/720-gluon-arp-limiter-start b/package/gluon-ebtables-limit-arp/files/lib/gluon/reload.d/720-gluon-arp-limiter-start
new file mode 100755
index 000000000..9db9ccf55
--- /dev/null
+++ b/package/gluon-ebtables-limit-arp/files/lib/gluon/reload.d/720-gluon-arp-limiter-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-arp-limiter start
diff --git a/package/gluon-ebtables/files/lib/gluon/reload.d/381-gluon-ebtables-stop b/package/gluon-ebtables/files/lib/gluon/reload.d/381-gluon-ebtables-stop
new file mode 100755
index 000000000..ab714cc23
--- /dev/null
+++ b/package/gluon-ebtables/files/lib/gluon/reload.d/381-gluon-ebtables-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-ebtables stop
diff --git a/package/gluon-ebtables/files/lib/gluon/reload.d/719-gluon-ebtables-start b/package/gluon-ebtables/files/lib/gluon/reload.d/719-gluon-ebtables-start
new file mode 100755
index 000000000..579c2e630
--- /dev/null
+++ b/package/gluon-ebtables/files/lib/gluon/reload.d/719-gluon-ebtables-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-ebtables start
diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/200-mesh-vpn-fastd-stop b/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/305-fastd-stop
similarity index 100%
rename from package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/200-mesh-vpn-fastd-stop
rename to package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/305-fastd-stop
diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/800-mesh-vpn-fastd-start b/package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/795-fastd-start
similarity index 100%
rename from package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/800-mesh-vpn-fastd-start
rename to package/gluon-mesh-vpn-fastd/files/lib/gluon/reload.d/795-fastd-start
diff --git a/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/200-mesh-vpn-tunneldigger-stop b/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/310-tunneldigger-stop
similarity index 100%
rename from package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/200-mesh-vpn-tunneldigger-stop
rename to package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/310-tunneldigger-stop
diff --git a/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/800-mesh-vpn-tunneldigger-start b/package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/790-tunneldigger-start
similarity index 100%
rename from package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/800-mesh-vpn-tunneldigger-start
rename to package/gluon-mesh-vpn-tunneldigger/files/lib/gluon/reload.d/790-tunneldigger-start
diff --git a/package/gluon-radv-filterd/files/lib/gluon/reload.d/350-gluon-radv-filterd-stop b/package/gluon-radv-filterd/files/lib/gluon/reload.d/350-gluon-radv-filterd-stop
new file mode 100755
index 000000000..07b9e1a84
--- /dev/null
+++ b/package/gluon-radv-filterd/files/lib/gluon/reload.d/350-gluon-radv-filterd-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-radv-filterd stop
diff --git a/package/gluon-radv-filterd/files/lib/gluon/reload.d/750-gluon-radv-filterd-start b/package/gluon-radv-filterd/files/lib/gluon/reload.d/750-gluon-radv-filterd-start
new file mode 100755
index 000000000..ce82fa018
--- /dev/null
+++ b/package/gluon-radv-filterd/files/lib/gluon/reload.d/750-gluon-radv-filterd-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-radv-filterd start
diff --git a/package/gluon-radvd/files/lib/gluon/reload.d/350-gluon-radvd-stop b/package/gluon-radvd/files/lib/gluon/reload.d/350-gluon-radvd-stop
new file mode 100755
index 000000000..9ec35cfee
--- /dev/null
+++ b/package/gluon-radvd/files/lib/gluon/reload.d/350-gluon-radvd-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-radvd stop
diff --git a/package/gluon-radvd/files/lib/gluon/reload.d/750-gluon-radvd-start b/package/gluon-radvd/files/lib/gluon/reload.d/750-gluon-radvd-start
new file mode 100755
index 000000000..820833ab2
--- /dev/null
+++ b/package/gluon-radvd/files/lib/gluon/reload.d/750-gluon-radvd-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-radvd start
diff --git a/package/gluon-respondd/files/lib/gluon/reload.d/100-respondd-stop b/package/gluon-respondd/files/lib/gluon/reload.d/350-gluon-respondd-stop
similarity index 100%
rename from package/gluon-respondd/files/lib/gluon/reload.d/100-respondd-stop
rename to package/gluon-respondd/files/lib/gluon/reload.d/350-gluon-respondd-stop
diff --git a/package/gluon-respondd/files/lib/gluon/reload.d/900-respondd-start b/package/gluon-respondd/files/lib/gluon/reload.d/750-gluon-respondd-start
similarity index 100%
rename from package/gluon-respondd/files/lib/gluon/reload.d/900-respondd-start
rename to package/gluon-respondd/files/lib/gluon/reload.d/750-gluon-respondd-start
diff --git a/package/gluon-wan-dnsmasq/files/lib/gluon/reload.d/340-gluon-wan-dnsmasq-stop b/package/gluon-wan-dnsmasq/files/lib/gluon/reload.d/340-gluon-wan-dnsmasq-stop
new file mode 100755
index 000000000..71a828399
--- /dev/null
+++ b/package/gluon-wan-dnsmasq/files/lib/gluon/reload.d/340-gluon-wan-dnsmasq-stop
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-wan-dnsmasq stop
diff --git a/package/gluon-wan-dnsmasq/files/lib/gluon/reload.d/760-gluon-wan-dnsmasq-start b/package/gluon-wan-dnsmasq/files/lib/gluon/reload.d/760-gluon-wan-dnsmasq-start
new file mode 100755
index 000000000..57f6506cf
--- /dev/null
+++ b/package/gluon-wan-dnsmasq/files/lib/gluon/reload.d/760-gluon-wan-dnsmasq-start
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/gluon-wan-dnsmasq start
-- 
GitLab