unrealircd

- supernets unrealircd source & configuration
git clone git://git.acid.vegas/unrealircd.git
Log | Files | Refs | Archive | README | LICENSE

patch_spamfilter_conf (996B)

      1 #!/bin/sh
      2 #
      3 # This script tries to upgrade spamfilter.conf from an old
      4 # version that uses 'posix' spamfilters to a bit more recent
      5 # version with examples using 'regex' spamfilters.
      6 # This so fewer users end up with a headache when upgrading
      7 # to UnrealIRCd 4.2.3+.
      8 #
      9 
     10 if [ -f spamfilter.conf.patch ]; then
     11 	F="`pwd`/spamfilter.conf.patch"
     12 elif [ -f extras/patches/spamfilter.conf.patch ]; then
     13 	F="`pwd`/extras/patches/spamfilter.conf.patch"
     14 else
     15 	echo "WARNING: spamfilter.conf.patch not found"
     16 	exit 0
     17 fi
     18 
     19 if [ ! -f "$F" ]; then
     20 	echo "WARNING: spamfilter.conf.patch not found in round two"
     21 	exit 0
     22 fi
     23 
     24 if [ "$1" = "" ]; then
     25 	echo "ERROR: No target confdir specified."
     26 	exit 0
     27 fi
     28 
     29 if [ ! -f "$1/spamfilter.conf" ]; then
     30 	echo "WARNING: no spamfilter.conf found in $1 -- strange"
     31 	exit 0
     32 fi
     33 
     34 cd "$1" || exit 1
     35 cat "$F"|patch -p0 --dry-run -N 1>/dev/null 2>&1
     36 if [ "$?" = 0 ]; then
     37 	# Patch succeeded, patch now!
     38 	echo "Upgrading examples in your spamfilter.conf..."
     39 	cat "$F"|patch -p0 -N
     40 fi