summaryrefslogtreecommitdiff
path: root/files/check-puppetd.sh
blob: c886ea312e8bc15949c3ee58d2557a72296cce06 (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/agent.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