iservchk: Test does not allow output, better use Shell; more exit codes in update...
[iserv-mod-error-reporter.git] / maint / update-config.sh
index 3cc0677..24d1a7e 100755 (executable)
@@ -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;
+
This page took 0.023228 seconds and 4 git commands to generate.