Below is a little script I made to make sure I have the latest config
handy when and if I have to reload the box:
I run it from cron every night.
Why is it that the portmaster only allows ONE pm* connection at a
time, while it allows three telnets?
It happens now and then that I forget to quit pmconsole and then my
cron jobs that alters a few locations from manual to demand and vice
versa, and this script fails.
Thomas
--------
#!/bin/sh
PATH=$PATH:/opt/pm
CONF=`date +conf.%Y%m%d`
cd /opt/pm/data
if [ $# != "2" ]; then
echo "Usage: pm_dump_conf.sh portmaster password"
exit 1
fi
if pmreadconf $1 $2 $CONF; then # can connect
if [ -f last_conf ]; then
if cmp -s $CONF last_conf; then
rm $CONF # equal, ignore
else
rm last_conf # config updated, save
ln -s $CONF last_conf
fi
else
ln -s $CONF last_conf # first time around
fi
else
rm $CONF # failed read, remove
fi
exit 0