>      WorkDir <path/to/dir>
>
> and it won't get recognized...

My mistake - how about 

        grep '^[ \t]*WorkDir' /etc/mrtg.cfg

or

        grep '^[[:space:]]WorkDir' /etc/mrtg.cfg

or

        grep '[^#].*WorkDir' /etc/mrtg.cfg


Whatever - grep does not need to be run twice.

Of course, the idea of running all of 

        if [ -x /usr/bin/mrtg ] && \
        [ -r /etc/mrtg.cfg ] && \
        [ -d "$(grep ^WorkDir /etc/mrtg.cfg | cut -d' ' -f2)" ]; \
        then mkdir -p /var/log/mrtg ; \
        env LANG=C /usr/bin/mrtg /etc/mrtg.cfg 2>&1 | tee -a 
/var/log/mrtg/mrtg.log ; \
        fi

_every_single_time_ the cron job is run from /etc/cron.d/mrtg is kind of
brain-dead, especially since, as with this bug, in the end, it did not work.

Using a cron job is NOT the efficient way to configure a system - but hey,
that's the "Debian Way".  For that matter, neither are init scripts an
efficient way to configure a system - _every_single_time_ the system boots,
whether it needs to be done or not, whether it works or not, ... - but I
digress...


James




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to