diff options
author | Patrick 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) |
commit | c78f36065a9a2e71f3446457636514ce62e50ab1 (patch) | |
tree | eeca34b156d95e30eee1e300ee56754e17ca8ac6 | |
parent | 87b0fb76a8f517bfce404fc1eb214a65a04d05c0 (diff) |
build: Split IFUP and IFDOWN
-rwxr-xr-x | build | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -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 \ |