#!/bin/sh

# These vars must be provided from
# FidoNMS base config

NMSBASE=/opt/fidonms
UPLINK="2:5030/731"

#These vars are built in-script
LFILE=$NMSBASE/etc/links

declare -a LLINKS
# The easiest way
readarray -t LLINKS < <(cat $LFILE | grep -e "^[Aa][Kk][Aa] " | awk '{ print $2 }')

for dlink in ${LLINKS[@]}; do
    $NMSBASE/bin/mkpoll.sh $dlink
    sync
done

#Poll UPLINK
$NMSBASE/bin/mkpoll.sh $UPLINK
