#!/bin/bash # # Copyright (c) 2009 Lindsay Holmwood # # flapjack-workers # Boots flapjack-workers, check executors for Flapjack. # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local:/usr/local/sbin:/usr/local/bin if [ -f /etc/default/flapjack-workers ]; then . /etc/default/flapjack-workers fi # Default return value RETVAL=0 if [ ! $(which flapjack-worker-manager) ]; then echo "flapjack-worker-manager isn't on your path." echo "Refusing to start." exit 1 fi # Evaluate command case "$1" in start) flapjack-worker-manager start --workers $WORKERS --checks-directory $CHECKS_DIRECTORY RETVAL=$? ;; stop) flapjack-worker-manager stop RETVAL=$? ;; restart) flapjack-worker-manager restart --workers $WORKERS RETVAL=$? ;; *) echo "Usage: flapjack-workers {start|stop|restart}" exit 1 ;; esac exit $RETVAL