#!/bin/sh
# 
# This script compiles the Italian fidonet nodelist received via TIC
# Copyright (C) 1996 by Marco d'Itri, 2:332/206.10 / md@linux.it

. /etc/ifmail/ifshellvars

if [ -r $IFSPOOL/inb/region33.zip ]; then
  unzip -L -o -p $IFSPOOL/inb/region33.zip \
    | sed "s/^;Zone,2,/Zone,2,/1" > $IFNLD/region.033.NEW
  { printf 'To: ftn\n'
    diff --unified=0 $IFNLD/region.033 $IFNLD/region.033.NEW; } \
  | sendmail -t
  mv $IFNLD/region.033.NEW $IFNLD/region.033
fi
tail -f -n0 $IFLOG &
TOKILL=$!
$IFBIN/ifindex
sleep 1
kill $TOKILL
mv  $IFSPOOL/inb/region33.zip  $IFSPOOL/inb/region33.OLD

