Module: check_mk
Branch: master
Commit: 08ce310f3fc74bd582d66ce5868dbf115226cc27
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=08ce310f3fc74b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 9 14:11:39 2016 +0100
.f12 scripts: set ONLY_COPY=1 to disable restart/start/reload of processes
---
bin/.f12 | 5 ++++-
doc/predictive/.f12 | 4 +++-
livestatus/.f12 | 9 ++++++---
modules/.f12 | 5 ++++-
pnp-templates/.f12 | 12 +++++++-----
web/.f12 | 7 +++++--
6 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/bin/.f12 b/bin/.f12
index 208a079..628c6ac 100644
--- a/bin/.f12
+++ b/bin/.f12
@@ -8,4 +8,7 @@ sudo install -m 755 livedump mkeventd mkeventd_open514 mkevent mkbackup
$OMD_ROO
sudo chown root.omd $OMD_ROOT/bin/mkeventd_open514
sudo chmod 4750 $OMD_ROOT/bin/mkeventd_open514
echo "Installed to $OMD_ROOT/bin"
-sudo omd restart $SITE mkeventd
+
+if [ -z $ONLY_COPY ]; then
+ sudo omd restart $SITE mkeventd
+fi
diff --git a/doc/predictive/.f12 b/doc/predictive/.f12
index 220cd74..d6b8a8a 100644
--- a/doc/predictive/.f12
+++ b/doc/predictive/.f12
@@ -7,4 +7,6 @@ sudo install -m 755 foo.agentplugin /usr/lib/check_mk_agent/plugins/foo
sudo install -m 644 foo.check /omd/sites/$SITE/local/share/check_mk/checks/foo
sudo install -m 644 foo.wato
/omd/sites/$SITE/local/share/check_mk/web/plugins/wato/foo.py
-sudo omd restart $SITE apache
+if [ -z $ONLY_COPY ]; then
+ sudo omd restart $SITE apache
+fi
diff --git a/livestatus/.f12 b/livestatus/.f12
index 25503b2..9ea9892 100755
--- a/livestatus/.f12
+++ b/livestatus/.f12
@@ -6,6 +6,9 @@ set -e
make -C .. livestatus/config.h
make -j8
sudo install src/livestatus.o /omd/sites/$SITE/lib/mk-livestatus/livestatus.o
-(cd api/python ; .f12 )
-echo "Restarting site $SITE"
-sudo omd restart $SITE nagios
+(cd api/python ; bash .f12 )
+
+if [ -z $ONLY_COPY ]; then
+ echo "Restarting site $SITE"
+ sudo omd restart $SITE nagios
+fi
diff --git a/modules/.f12 b/modules/.f12
index a7c6c61..12c38dc 100644
--- a/modules/.f12
+++ b/modules/.f12
@@ -2,4 +2,7 @@
SITE=${SITE:-$(cat ../.site)}
SITE=${SITE:-$(omd sites --bare | head -n 1)}
sudo cp -v *.py /omd/sites/$SITE/share/check_mk/modules/
-sudo su - $SITE -c "cmk --debug -R"
+
+if [ -z $ONLY_COPY ]; then
+ sudo su - $SITE -c "cmk --debug -R"
+fi
diff --git a/pnp-templates/.f12 b/pnp-templates/.f12
index b8f7795..5d82c85 100644
--- a/pnp-templates/.f12
+++ b/pnp-templates/.f12
@@ -3,9 +3,11 @@ SITE=${SITE:-$(cat ../.site || true)}
SITE=${SITE:-$(omd sites --bare | head -n 1)}
sudo rsync --delete -varx ./ /omd/sites/$SITE/share/check_mk/pnp-templates/
-# do nc to port 32000 only if there is someone listening
-# (otherwise complete f12 script breaks if no listener on 32000)
-if [ $(nmap -PN -p 32000 localhost | egrep "32000.*open" | wc -l) -gt 0 ]
-then
- echo 'location.reload();' | nc -w 0 localhost 32000
+if [ -z $ONLY_COPY ]; then
+ # do nc to port 32000 only if there is someone listening
+ # (otherwise complete f12 script breaks if no listener on 32000)
+ if [ $(nmap -PN -p 32000 localhost | egrep "32000.*open" | wc -l) -gt 0 ]
+ then
+ echo 'location.reload();' | nc -w 0 localhost 32000
+ fi
fi
diff --git a/web/.f12 b/web/.f12
index f41556b..05aa9a4 100644
--- a/web/.f12
+++ b/web/.f12
@@ -7,8 +7,11 @@ sudo rsync \
-varx htdocs plugins /omd/sites/$SITE/share/check_mk/web/
# --delete \
echo "$C files copied"
-if [ "$SITE" != - ] ; then
- sudo omd restart $SITE apache
+
+if [ -z $ONLY_COPY ]; then
+ if [ "$SITE" != - ] ; then
+ sudo omd restart $SITE apache
+ fi
fi
# Per Default wird geguckt, ob die *_min.js-Dateien älter sind, als