#!/bin/bash if [ "$1" == 'debug' ]; then set -x; shift; fi if [ "$1" == 'debug2' ]; then set -xvT; shift; fi # - WatchMX - ############################################## # Don't write with 'logger' to the maillog # ... which ends up in recursion and crash ... ############################################## #------------------------- REALPATH=`realpath $0` WHERE=`dirname $REALPATH` ME=`basename $REALPATH` cd $WHERE . ../../system.conf . ../../watcher.conf . ../../common.conf . ../../common.bashlib #------------------------- . WatchMX.conf . private.bashlib IPs=`$SQL "select IP from mailhogs where class='';"` echo $IPs for ip in $IPs do CLASS=`get_class $ip` echo "$ip $CLASS" $SQL "update mailhogs set class='$CLASS' where IP='$ip';" done