summaryrefslogtreecommitdiff
path: root/files/check-puppetd.sh
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2009-12-30 15:42:55 -0200
committerSilvio Rhatto <rhatto@riseup.net>2009-12-30 15:42:55 -0200
commit5c73c32c08f22cc57eb48812591e119fbb14b457 (patch)
tree593203121f646ca91166dcd27781177e1a3d167f /files/check-puppetd.sh
downloadpuppet-puppet-5c73c32c08f22cc57eb48812591e119fbb14b457.tar.gz
puppet-puppet-5c73c32c08f22cc57eb48812591e119fbb14b457.tar.bz2
Initial import
Diffstat (limited to 'files/check-puppetd.sh')
-rw-r--r--files/check-puppetd.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/files/check-puppetd.sh b/files/check-puppetd.sh
new file mode 100644
index 0000000..fbf6988
--- /dev/null
+++ b/files/check-puppetd.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# check if puppet is running
+#
+
+PID="/var/run/puppet/puppetd.pid"
+INIT="/etc/init.d/puppet"
+
+if [ ! -f "$PID" ]; then
+ $INIT start
+else
+ running="$(ps $(cat $PID) &> /dev/null)"
+ if [ "$?" != "0" ]; then
+ $INIT start
+ fi
+fi