#!/bin/bash # # Copyright (c) 2009-2011 Lindsay Holmwood # # flapjack-notifier # Boots flapjack-notifier, notifier for Flapjack. # PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local:/usr/local/sbin:/usr/local/bin:/usr/lib/flapjack/bin if [ -f /etc/default/flapjack-notifier ]; then . /etc/default/flapjack-notifier fi # Default return value RETVAL=0 if [ ! $(which flapjack-notifier-manager) ]; then echo "Error: flapjack-notifier-manager isn't on your path." echo "Refusing to start!" exit 1 fi # Evaluate command case "$1" in start) flapjack-notifier-manager start --recipients $RECIPIENTS \ --port $BEANSTALKD_PORT --beanstalk $BEANSTALKD_ADDR RETVAL=$? ;; stop) flapjack-notifier-manager stop --recipients $RECIPIENTS \ --port $BEANSTALKD_PORT --beanstalk $BEANSTALKD_ADDR RETVAL=$? ;; restart) flapjack-notifier-manager restart --recipients $RECIPIENTS \ --port $BEANSTALKD_PORT --beanstalk $BEANSTALKD_ADDR RETVAL=$? ;; *) echo "Usage: flapjack-notifier {start|stop|restart}" RETVAL=1 ;; esac exit $RETVAL