#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
##
##  rc.heise -- Run-Commands for heise
##

%config
    heise_enable="yes"
    heise_idx_numfiles="10"
    heise_idx_complevel="9"
    heise_url="ftp://ftp.heise.de/pub/ct/register/register.zip"

%weekly -u @l_musr@
    opServiceEnabled heise || exit 0

    #   fetch new index data
    ( cd @l_prefix@/var/heise \
          && @l_prefix@/bin/curl -s -o register.zip ${heise_url} \
          && @l_prefix@/bin/shtool rotate -f \
              -n${heise_idx_numfiles} -s0 \
              -z${heise_idx_complevel} -o@l_musr@ -g@l_mgrp@ -m644 \
              inhalt.frm \
          && @l_prefix@/bin/unzip -jop register.zip INHALT.FRM > inhalt.frm
    )

