diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-09-23 12:27:25 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-09-23 12:27:25 (EDT) |
commit | 7861c55fa505244c44469795617621c0a47ebafa (patch) | |
tree | ad98a7ed5946fea8aad80827bff53a0a3880d04a /build | |
parent | e9e66632d0566851ac51c907642418ecbe69b46e (diff) |
Conditionally install networking hooks
Diffstat (limited to 'build')
-rwxr-xr-x | build | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -73,11 +73,17 @@ install: build 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}"; \ - if [ -d "../src.etc/network/$${dir}" ]; then \ - install -m 0755 "../src.etc/network/$${dir}/"* \ - "dest/etc/network/$${dir}"; \ - fi; \ 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 \ + [ -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 UDHCPC; then \ install -d -m 0755 dest/usr/share/udhcpc; \ |