diff options
Diffstat (limited to 'files/check-puppetd.sh')
-rw-r--r-- | files/check-puppetd.sh | 16 |
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 |