From: Roland Hieber Date: Sat, 6 Mar 2010 03:24:38 +0000 (+0100) Subject: ...and update script to convert old PHP based config into /etc/iserv/config X-Git-Tag: REL_10.03.08~16 X-Git-Url: https://git.rohieb.name/iserv-mod-error-reporter.git/commitdiff_plain/682344f5cd56427b3951c8f262d8a67f00cea89c ...and update script to convert old PHP based config into /etc/iserv/config --- diff --git a/maint/update-config.sh b/maint/update-config.sh new file mode 100644 index 0000000..3cc0677 --- /dev/null +++ b/maint/update-config.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# called by iservchk +# convert the old, PHP based config file to /etc/iserv/config + +OLDCFG=/usr/share/iserv/www/inc/mod_error-reporter/config.inc +NEWCFG=/etc/iserv/config +TMPCFG=`mktemp` +rm -rf $TMPCFG + +# mail notify +if [ -n "`grep 'setMailNotify(' $OLDCFG|grep false`" ]; then + sed 's/^ErrorReporterMailNotify.\+/ErrorReporterMailNotify = false/' $NEWCFG > $TMPCFG + mv $TMPCFG $NEWCFG +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 +fi; +