X-Git-Url: https://git.rohieb.name/iserv-mod-error-reporter.git/blobdiff_plain/30c8dbb9db85a83ba05388adaaf553ed6466229c..53f4eedd6e44bd954a22723f70b8c8d453d03847:/maint/update-config.sh diff --git a/maint/update-config.sh b/maint/update-config.sh index 3cc0677..24d1a7e 100755 --- a/maint/update-config.sh +++ b/maint/update-config.sh @@ -10,13 +10,16 @@ rm -rf $TMPCFG # 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; +