openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ff0f86b1975b77e13cbc2139b4c84727d00dd575
parent 726da841049c15896321a64fc9a0d3eca9daac22
Author: dankert <devnull@localhost>
Date:   Mon, 19 Mar 2012 21:30:44 +0100

Konvertierungstool in neue Konfigurationsdatei.

Diffstat:
config/convert.sh | 40++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+), 0 deletions(-)

diff --git a/config/convert.sh b/config/convert.sh @@ -0,0 +1,39 @@ +#!/bin/bash +echo "# `date`" +echo "#" +echo ";;PHP \$conf = array();" + +for fn in *.ini.php; do + + fn="${fn:-8}" + echo "#" + echo "# converted from $fn" + echo ";;PHP \$conf['${fn}'] = array();" + + ru= + sec="${fn}." + + while read line; do + if [ "${line:0:1}" == "[" ]; then + sec="${fn}.${line:1}." + ru="$line" + echo ";;PHP \$conf['${fn}']['${ru}'] = array();" + echo "; next section: $line" + elif [ "${line:0:2}" == ";[" ]; then + sec="${fn}.${line:2}." + ru="${line;1}" + echo ";;PHP \$conf['${fn}']['${ru}'] = array();" + echo "; next unused section: $line" + elif [ "$line" == "" ]; then + echo "" + elif [ "${line:0:2}" == "; " ]; then + echo "$line" + elif [ "${line:0:1}" == ";" ]; then + echo ";${sec}${line:1}" + echo ";;PHP \$conf['${fn}']['${ru}']=${line:1};" + else + echo ";;PHP \$conf['${fn}']['${ru}']=$line;" + echo "${sec}${line}" + fi + done < $fn +done+ \ No newline at end of file