# HG changeset patch # User meillo@marmaro.de # Date 1279743175 -7200 # Node ID c5d31941881370ab1814c305db28db19c084c8bd # Parent 92b58989a09e0f3ac94c96d114da55bdf0c9fc8c added config-transition this script takes config files and checks them for obsolete options if any found, it outputs them if called with -v it also explains how to substitute them the usual call: config-transition -v /etc/masqmail/* diff -r 92b58989a09e -r c5d319418813 contrib/config-transition --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/config-transition Wed Jul 21 22:12:55 2010 +0200 @@ -0,0 +1,135 @@ +#!/bin/sh +# +# check masqmail config files for options that are obsolete +# -v enables verbose output +# +# 2010 markus schnalke + +if [ $# -eq 0 ] ; then + echo "usage: config-transition [-v] CONFIGFILE..." >&2 + exit 1 +fi + +awkscript="/tmp/masqmail-config-transition-$$" + +trap 'rm -f "$awkscript"; exit' INT QUIT TERM EXIT + +cat >"$awkscript" < that you used this option. \ +We still don't know the rationale behind this option. \ +All we have is a comment in the code saying: This option is used by sqilconf. \ +" + +# get files + +# already covered by the get.* and online_gets.* options in the conf +# file. This check is just to make sure, because one might only check +# the get file. +# We don't check for the other get file options, which are: +# protocol server port wrapper user pass address return_path do_keep +# do_uidl do_uidl_dele max_size max_size_delete max_count resolve_list + +check["protocol.*pop"] = "get" SUBSEP "Removed in 0.3.0" SUBSEP "\ +The POP3 client was removed from masqmail. \ +Use a dedicated POP3 client, e.g. fetchmail, instead. \ +" + + +######## END OF CHECK DEFINITIONS ######## +} + +function checkcomment() { + if (/^[ \t]*\#/) { + return " (in a comment)" + } +} + +{ + for (key in check) { + if (\$0 !~ key) { + continue; + } + # we have a match + split(check[key], a, SUBSEP); # array index starts with 1 + printf("%s:%d: [%s] %s%s\n", FILENAME, NR, a[1], key, checkcomment()); + cmd = "fold -sw 70 | sed 's,^,\t,'" + if (verbose) { + print "\t>>>> " \$0 " <<<<" + print a[3] | cmd + close(cmd) + print "\t" a[2] + print "" + } + } +} + +! + + +verbose=0 +if [ X"$1" = X"-v" ] ; then + verbose=1 + shift +fi + +for i do + awk -f "$awkscript" "verbose=$verbose" "$i" +done +