[omd-commits] OMD Git: omd: Move lq from check_mk to mk-livestatus

git version control git at mathias-kettner.de
Mon Dec 20 19:54:51 CET 2010


Module: omd
Branch: master
Commit: 98638479aec4a8cbc7e7d3057982a20f789df546
URL:    http://omdistro.org/projects/omd/repository/revisions/98638479aec4a8cbc7e7d3057982a20f789df546

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Mon Dec 20 19:54:11 2010 +0100

Move lq from check_mk to mk-livestatus

And allow query to be read from stdin

---

 packages/check_mk/Makefile      |    1 -
 packages/mk-livestatus/Makefile |    2 ++
 packages/mk-livestatus/lq       |    8 ++++++--
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/packages/check_mk/Makefile b/packages/check_mk/Makefile
index 5dc479b..9221a1f 100644
--- a/packages/check_mk/Makefile
+++ b/packages/check_mk/Makefile
@@ -58,7 +58,6 @@ install:
 	ln -sfn check_mk $(DESTDIR)$(OMD_ROOT)/bin/cmk
 	echo -e '#!/bin/sh\nexec check_mk -P "$$@"' > $(DESTDIR)$(OMD_ROOT)/bin/mkp
 	chmod 755 $(DESTDIR)$(OMD_ROOT)/bin/mkp
-	install -m 755 lq       $(DESTDIR)$(OMD_ROOT)/bin
 
 	# defaults.py for Multisite which redirects to site specific defaults
 	install -m 644 defaults.py $(DESTDIR)$(OMD_ROOT)/share/check_mk/web/htdocs
diff --git a/packages/mk-livestatus/Makefile b/packages/mk-livestatus/Makefile
index 5abf05b..01732b2 100644
--- a/packages/mk-livestatus/Makefile
+++ b/packages/mk-livestatus/Makefile
@@ -14,6 +14,8 @@ build:
 
 install:
 	$(MAKE) DESTDIR=$(DESTDIR) -C $(DIR) install
+	mkdir -p $(DESTDIR)$(OMD_ROOT)/bin
+	install -m 755 lq $(DESTDIR)$(OMD_ROOT)/bin
 
 skel:
 
diff --git a/packages/mk-livestatus/lq b/packages/mk-livestatus/lq
index 44ec2c2..861519b 100644
--- a/packages/mk-livestatus/lq
+++ b/packages/mk-livestatus/lq
@@ -1,3 +1,7 @@
 #!/bin/bash
-echo -e "$1" | unixcat ~/tmp/run/live
-exit $?
+if [ $# -ge 1 ]
+then
+    echo -e "$@" 
+else
+    cat
+fi | unixcat ~/tmp/run/live



More information about the omd-commits mailing list