From 682344f5cd56427b3951c8f262d8a67f00cea89c Mon Sep 17 00:00:00 2001 From: Roland Hieber Date: Sat, 6 Mar 2010 04:24:38 +0100 Subject: [PATCH] ...and update script to convert old PHP based config into /etc/iserv/config --- maint/update-config.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 maint/update-config.sh 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; + -- 2.20.1