# mail notify
if [ -n "`grep 'setMailNotify(' $OLDCFG|grep false`" ]; then
sed 's/^ErrorReporterMailNotify.\+/ErrorReporterMailNotify = false/' $NEWCFG > $TMPCFG
- mv $TMPCFG $NEWCFG
+ mv $TMPCFG $NEWCFG || (echo "Could not save config!" && exit 255);
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
+ mv $TMPCFG $NEWCFG || (echo "Could not save config!" && exit 255);
fi;
+mv $OLDCFG $OLDCFG.converted
+[ -e "$OLDCFG" ] && echo "Done. Please remove the old config file ($OLDCFG) by hand!" && exit 255;
+
+# write new config
+iservchk config
+