AtOM/lib/config/getConfig
Vincent Riquer 9cde5ba272 Setup
* -S option
	* call setup when no conf file present
	* [general] setup
2013-06-17 13:39:28 +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"
}