libhbalinux should add itself to the hba.conf file when installed.

This will add an entry to the existing hba.conf file only if a
matching entry does not already exist.

Signed-off-by: Chris Leech <[email protected]>
---

 Makefile.am |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 47e8864..b0ab765 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,3 +10,22 @@ libhbalinux_la_LIBADD = $(PCIACCESS_LIBS)
 
 dist_noinst_DATA = README COPYING INSTALL libhbalinux.spec
 
+install-data-hook: libhbalinux.la
+       . $<; \
+       ORG=org.open-fcoe.libhbalinux; \
+       LIB=${libdir}/$${dlname}; \
+       STR="$$ORG      $$LIB"; \
+       CONF=${sysconfdir}/hba.conf; \
+       if test -f $$CONF; then \
+               grep -E -q ^[[:space:]]*$$ORG[[:space:]]+$$LIB $$CONF; \
+               if test $$? -ne 0; then \
+                       echo $$STR >> $$CONF; \
+               else \
+                       echo "** $$CONF already configured"; \
+                       echo "** system configuration not updated"; \
+               fi; \
+       else \
+               echo "** WARNING: $$CONF does not exist"; \
+               echo "** system configuration not updated"; \
+       fi
+

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to