#!/bin/sh

if [ -f /etc/init.d/pubsubd ]; then
    /etc/init.d/pubsubd start
    if [ ! $? -eq 0 ]; then
	echo "Failed to start /etc/init.d/pubsubd: $?"
	exit $?
    fi
    #
    # runit expects the run file to continue execution until death.
    #
    while [ 1 -eq 1 ]; do
        sleep 60
    done
else
    sv down pubsubd
fi

exit 0
