#!/bin/sh

# cronloop  - concept taken from Debian
#             and Red Hat

# keep going when something fails
set +e

if [ $# -lt 1 ]; then
  echo "Usage: cronloop <time-qualifier>" 2>&1
  exit 1
fi

D=/etc/cron.d/$1
if [ ! -d $D ]; then
  echo "No such directory: $D" 2>&1
  exit 1
fi

for i in $D/* ; do
  if [ -x $i ]; then
    # should we detect ownership and su(1) appropriately?
    $i
  fi
done

exit 0
