# MRTG uses GD for the graphics parts. The GD web site (www.libgd.org)
# is down as I write this, the original GD web site (www.boutell.com/gd)
# mentions it as well, but does not offer tarball downloads. If you
# have Mercurial from here:
# https://bitbucket.org/pierrejoye/gd-libgd
#
# Probably easier to just let MRTG to use Slackware's GD, but it does
# include Mercurial too...
cd
test -f installed/mrtg/mrtg-2.17.4.tar.gz &&
mv installed/mrtg/mrtg-2.17.4.tar.gz .
test ! -f mrtg-2.17.4.tar.gz &&
wget http://oss.oetiker.ch/mrtg/pub/mrtg-2.17.4.tar.gz
mkdir -p -m 0700 src/mrtg
find src src/mrtg -maxdepth 1 -type d -name "mrtg-*" -exec rm -r {} \;
cd src/mrtg
tar xzvf ~/mrtg-2.17.4.tar.gz
cd mrtg-2.17.4
test $UID = 0 && chown -R root:root .
# Read this:
# doc/mrtg-unix-guide.txt
./configure
make
# Become root to back up files and to install it
su
# I run this to back up my existing mrtg files. I use rrdtool with mrtg
# and have a lot of .rrd files in a 'data' subdirectory that I created.
test -d /usr/local/mrtg-2 &&
mkdir -p -m 0700 ~/backup/mrtg &&
find /usr/local/mrtg-2 -maxdepth 1 -type f -exec cp {} ~/backup/mrtg/ \; &&
chown -R root:root ~/backup/mrtg &&
chmod 700 ~/backup/mrtg &&
chmod 600 ~/backup/mrtg/*
test -d /usr/local/mrtg-2/data &&
( find /usr/local/mrtg-2/data -type f -name "*.png" -exec rm {} \;
tar cjvf ~/backup/mrtg/data-`date +%Y%m%d`.tar.bz2 /usr/local/mrtg-2/data
chmod 600 ~/backup/mrtg/data-`date +%Y%m%d`.tar.bz2 )
# Remove old docs, then install it
test -d /usr/local/mrtg-2/doc && rm -r /usr/local/mrtg-2/doc
test -d /usr/local/mrtg-2/man && rm -r /usr/local/mrtg-2/man
make install