#!/bin/sh
#
# There should be a scamper-config file with PPS, and a monitor-config
# file that contains ARK_MONITOR.

CYCLE=${1?}
TARGET_PATH=${2?}
INPROGRESS_PATH=${3?}

# monitor-config contains ARK_MONITOR
# monitor-config sometimes contains ARK_IPV4_INITIAL_TTL
. /etc/ark/monitor-config

# scamper-config contains PPS
. /etc/ark/activity-team-probing/scamper-config

OPTIONS=
if test -n "$ARK_IPV4_INITIAL_TTL"; then
    OPTIONS="-f $ARK_IPV4_INITIAL_TTL"
fi

/usr/bin/scamper -p $PPS -M $ARK_MONITOR -C $CYCLE \
		 -c "trace -P icmp-paris -q 3 -l 1 $OPTIONS" -O warts.gz \
		 -o $INPROGRESS_PATH -f $TARGET_PATH >/dev/null 2>&1
