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