#!/bin/bash
exec 2>&1
if [ -x /opt/logjam/bin/logjam-livestream ]; then
    livestream=/opt/logjam/bin/logjam-livestream
elif [ -x /usr/local/bin/logjam-livestream ]; then
    livestream=/usr/local/bin/logjam-livestream
elif [ "$(which logjam-livestream)" != "" ]; then
    livestream=logjam-livestream
else
    echo "ERROR: no logjam-livestream binary found"
    sleep 10
    exit 1
fi

if test -f /etc/default/logjam; then
    set -a; source /etc/default/logjam; set +a
fi

exec $livestream --bind-ip BIND_IP
