summaryrefslogtreecommitdiff
path: root/files/check-puppetd.sh
blob: fbf698823144a963326993c0f54f3a27ed4e48d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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