summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-12-10 06:16:25 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-12-10 06:16:25 (EST)
commitc78f36065a9a2e71f3446457636514ce62e50ab1 (patch)
treeeeca34b156d95e30eee1e300ee56754e17ca8ac6 /build
parent87b0fb76a8f517bfce404fc1eb214a65a04d05c0 (diff)
build: Split IFUP and IFDOWN
Diffstat (limited to 'build')
-rwxr-xr-xbuild27
1 files changed, 21 insertions, 6 deletions
diff --git a/build b/build
index e8aff78..6b2bef8 100755
--- a/build
+++ b/build
@@ -74,16 +74,31 @@ install: build
if config_enabled HTTPD; then \
install -d -m 0755 dest/var/www; \
fi; \
- if config_enabled IFUP && config_enabled IFDOWN; then \
+ if config_enabled IFUP || config_enabled IFDOWN; then \
install -d -m 0755 dest/etc; \
- for dir in '' if-pre-up.d if-up.d if-down.d if-post-down.d; do \
- install -d -m 0755 "dest/etc/network/$${dir}"; \
- done; \
install -m 0644 ../src.etc/network/functions \
dest/etc/network/; \
+ fi; \
+ if config_enabled IFUP; then \
+ for dir in '' if-pre-up.d if-up.d; do \
+ install -d -m 0755 "dest/etc/network/$${dir}"; \
+ done; \
+ while read -r config hook; do \
+ for dir in if-pre-up.d if-up.d; do \
+ [ -f "../src.etc/network/$${dir}/$${hook}" ] \
+ || continue; \
+ config_enabled "$${config}" && install -m 0755 \
+ "../src.etc/network/$${dir}/$${hook}" \
+ "dest/etc/network/$${dir}"; \
+ done; \
+ done <../network-hooks; \
+ fi; \
+ if config_enabled IFDOWN; then \
+ for dir in '' if-down.d if-post-down.d; do \
+ install -d -m 0755 "dest/etc/network/$${dir}"; \
+ done; \
while read -r config hook; do \
- for dir in if-pre-up.d if-up.d if-down.d \
- if-post-down.d; do \
+ for dir in if-down.d if-post-down.d; do \
[ -f "../src.etc/network/$${dir}/$${hook}" ] \
|| continue; \
config_enabled "$${config}" && install -m 0755 \