HAProxy init script Ubuntu

I've been learning haproxy as of late and I must say.. so far it's awesome. I use it to front my nginx servers and now I've gotten it to work in front of my Wowza boxes as well. Yes it handles RTMP and RTMPT nicely thus far.

I looked around for some time for a good script to manage my haproxy service but wasn't able to find one that just "worked". I did find one that I modified to suit my needs.. so here you are. I included a link back to the location where I found the initial script as well.

#!/bin/bash
# haproxyd
# Script to start|stop|restart haproxy from /etc/init.d/
# By Gubatron. http://www.gubatron.com/blog/2011/04/06/have-the-latest-haproxy-as-a-ubu...
# Modified by Jake Hilton

HAPROXY_CONF=/etc/haproxy/haproxy.cfg
HAPROXY_PATH=/usr/local/sbin
HAPROXY_DAEMON=$HAPROXY_PATH/haproxy

test -x $HAPROXY_DAEMON || exit 0

set -e

function getHaproxyPID() {
PID=`ps aux | grep 'haproxy -D' | grep -v "grep" | awk '{ print $2 }'`
}

case $1 in
start)
echo "Starting haproxy..."
$HAPROXY_DAEMON -D -f $HAPROXY_CONF
;;
restart)
echo "Hot restart of haproxy"
getHaproxyPID
COMMAND="$HAPROXY_DAEMON -D -f $HAPROXY_CONF -sf $PID"
echo $COMMAND
`$COMMAND`
;;
stop)
echo "Stopping haproxy"
getHaproxyPID
COMMAND="kill -9 $PID"
echo $COMMAND
`$COMMAND`
;;
*)
echo "Usage: haproxyd {start|restart|stop}" >&2
exit 1
;;
esac

exit 0