summaryrefslogtreecommitdiff
path: root/templates/check-puppetd.sh.erb
diff options
context:
space:
mode:
Diffstat (limited to 'templates/check-puppetd.sh.erb')
-rw-r--r--templates/check-puppetd.sh.erb5
1 files changed, 4 insertions, 1 deletions
diff --git a/templates/check-puppetd.sh.erb b/templates/check-puppetd.sh.erb
index 639a1d5..80ea3f6 100644
--- a/templates/check-puppetd.sh.erb
+++ b/templates/check-puppetd.sh.erb
@@ -3,6 +3,7 @@
# check if puppet is running
#
+PATH="$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
PID="/var/run/puppet/<%= puppet_agent_name %>.pid"
INIT="/etc/init.d/puppet"
@@ -11,7 +12,9 @@ function puppet_start {
$INIT start
}
-if [ ! -f "$PID" ]; then
+if [ "$1" == "restart" ]; then
+ puppet_restart
+elif [ ! -f "$PID" ]; then
puppet_start
else
running="$(ps $(cat $PID) &> /dev/null)"