#!/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

mkdir -p /etc/ark/activity-team-probing/
if [ ! -s /etc/ark/activity-team-probing/scamper-config ]; then
    echo "PPS=${SCAMPER_PPS:-100}" > /etc/ark/activity-team-probing/scamper-config
fi

echo "Starting ark-activity-team-probing..."
exec chpst -u ark /usr/bin/ark-team-prober -m "${ARK_MONITOR}"
