-Test 'import configuration from IServ 1'
- '[ ! -f /old/opt/iserv/idesk/inc/error-reporter/config.inc.rpmsave ]'
- /usr/share/iserv/modules/error-reporter/update-config-from-iserv1.sh
-Test 'update old config'
- '[ ! -f /usr/share/iserv/www/inc/mod_error-reporter/config.inc ]'
- /usr/share/iserv/modules/error-reporter/update-config
-Shell 'update database' /usr/share/iserv/modules/error-reporter/update-database
+Shell 'import configuration from IServ 1'
+ if [ -f /old/opt/iserv/idesk/inc/error-reporter/config.inc.rpmsave ]; then
+ /usr/share/iserv/modules/error-reporter/update-config-from-iserv1.sh
+ fi;
+Shell 'update old config'
+ if [ -f /usr/share/iserv/www/inc/mod_error-reporter/config.inc ]; then
+ /usr/share/iserv/modules/error-reporter/update-config.sh
+ fi;
+Shell 'update database'
+ /usr/share/iserv/modules/error-reporter/update-database.php
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
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;
# 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;
+