X-Git-Url: https://git.rohieb.name/iserv-mod-error-reporter.git/blobdiff_plain/4a857f7f1fdbcf7cd9d453875c060cba3b3b344c..e9f2b961b77ab316f83a603e6e3fed7f402217cd:/maint/update-config.sh diff --git a/maint/update-config.sh b/maint/update-config.sh index 3cc0677..651a387 100755 --- a/maint/update-config.sh +++ b/maint/update-config.sh @@ -10,13 +10,19 @@ 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; + +# write new config +iservchk config +