#!/usr/bin/env /lib/runit/invoke-run

set -e

. /etc/ark/monitor-config

# logging only captures stdout, so merge stderr in with it
exec 2>&1

if [ -f /etc/ark/fireball-dev/config ]; then
    . /etc/ark/fireball-dev/config
fi

#SCAMPER_REMOTE=${SCAMPER_REMOTE:"fireball.caida.org:3474"}
#SCAMPER_PPS=${SCAMPER_PPS:-100}
SCAMPER_REMOTE="fireball.caida.org:3476"
SCAMPER_PPS=100

echo "Starting ark-activity-fireball-dev..."
exec /usr/bin/scamper-test \
         -R "${SCAMPER_REMOTE}" \
         -p "${SCAMPER_PPS}" \
         -M "${ARK_FQDN}" \
         -O "cafile=/etc/ssl/certs/ca-certificates.crt" \
         -O "client-certfile=/etc/ark/ssl/${ARK_FQDN}.crt" \
         -O "client-privfile=/etc/ark/ssl/${ARK_FQDN}.key"
