+#!/bin/bash
+# called by iservchk
+# convert the old, PHP based config file to /etc/iserv/config
+
+OLDCFG=/usr/share/iserv/www/inc/mod_error-reporter/config.inc
+NEWCFG=/etc/iserv/config
+TMPCFG=`mktemp`
+rm -rf $TMPCFG
+
+# mail notify
+if [ -n "`grep 'setMailNotify(' $OLDCFG|grep false`" ]; then
+ sed 's/^ErrorReporterMailNotify.\+/ErrorReporterMailNotify = false/' $NEWCFG > $TMPCFG
+ mv $TMPCFG $NEWCFG
+fi;
+
+# mail notify address
+mailNotifyAddress=`grep setMailNotifyAddr $OLDCFG | sed -e 's/\$cfgErrors->setMailNotifyAddr//' | tr -d '();'|tr "'();" '"'`
+if [ -n "$mailNotifyAddress" ]; then
+ sed "s/^ErrorReporterMailAddress.\+/ErrorReporterMailAddress = $mailNotifyAddress/" $NEWCFG > $TMPCFG
+ mv $TMPCFG $NEWCFG
+fi;
+