2013-06-19 11:07:39 +02:00

30 lines
408 B
Bash

#!/bin/bash
getConfig() {
while read key value
do
case $key in
'#'*)
#comment
;;
'')
#empty line
;;
'[general]')
context=General
;;
'[source]')
context=Source
;;
\[*\])
context=Destination
destination="${key#[}"
destination="${destination%]}"
destinations+=("${destination%]}")
;;
*)
getConfig$context
;;
esac
done < "$cffile"
}