iservchk: Test does not allow output, better use Shell; more exit codes in update...
[iserv-mod-error-reporter.git] / maint / update-config-from-iserv1.sh
index 7779e76..467e17a 100755 (executable)
@@ -3,9 +3,9 @@
 OLDCFG=/old/opt/iserv/idesk/inc/error-reporter/config.inc.rpmsave
 NEWCFG=/usr/share/iserv/www/inc/mod_error-reporter/config.inc
 
-touch $NEWCFG || exit 1;
-chmod u+wr $NEWCFG || exit 1;
-chown www-data $NEWCFG || exit 1;
+touch $NEWCFG || (echo "FATAL: Could not create $NEWCFG!" && exit 255);
+chmod u+wr $NEWCFG || (echo "FATAL: Could not chmod +uwr $NEWCFG!" && exit 255);
+chown www-data $NEWCFG || (echo "FATAL: Could not chown www-data $NEWCFG!" && exit 255);
 
 # filter unused options
 cat $OLDCFG|grep -v setAdminGroups|grep -v setLog|grep -v @package > $NEWCFG
@@ -17,4 +17,5 @@ for i in $ADMGROUPS; do
   echo "added adminship for group '$i'"
 done;
 
-rm -f $OLDCFG || (echo "Error: Please remove the old config file by hand!" && exit 1);
+mv $OLDCFG $OLDCFG.converted
+[ -e $OLDCFG ] && echo "Done. Please remove the old config file ($OLDCFG) by hand!" && exit 255;
This page took 0.020068 seconds and 4 git commands to generate.