AtOM/lib/config/getConfig
Vincent Riquer 37df18f45d implement -c
2013-04-08 03:01:44 +02:00

29 lines
369 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%]}"
;;
*)
getConfig$context
;;
esac
done < "$cffile"
}