|
#!/bin/bash
|
|
#
|
|
# Given the name of a mrtg target and a new target name, move the files
|
|
# around to match the new name.
|
|
#
|
|
|
|
if [ -z "$1" ]; then
|
|
echo need source name
|
|
exit 1
|
|
fi
|
|
SRC=$1
|
|
|
|
if [ -z "$2" ]; then
|
|
echo need dest name
|
|
exit 1
|
|
fi
|
|
DST=$2
|
|
|
|
if [ ! -f $SRC.log ]; then
|
|
echo source $SRC.log does not exist
|
|
exit 1
|
|
fi
|
|
|
|
for i in .log .old .html -day.gif -month.gif -week.gif -year.gif -day.png -month.png -week.png -year.png; do
|
|
|
|
if [ -f $SRC$i ]; then
|
|
mv $SRC$i $DST$i
|
|
fi
|
|
done
|
|
|
|
|