...and update script to convert old PHP based config into /etc/iserv/config
authorRoland Hieber <devnull@localhost>
Sat, 6 Mar 2010 03:24:38 +0000 (04:24 +0100)
committerRoland Hieber <devnull@localhost>
Sat, 6 Mar 2010 03:24:38 +0000 (04:24 +0100)
maint/update-config.sh [new file with mode: 0644]

diff --git a/maint/update-config.sh b/maint/update-config.sh
new file mode 100644 (file)
index 0000000..3cc0677
--- /dev/null
@@ -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;
+
This page took 0.021904 seconds and 4 git commands to generate.