diff options
Diffstat (limited to 'build')
-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 \ |