diff --git a/atom b/atom index 554bb2f..b1aa548 100755 --- a/atom +++ b/atom @@ -4,6 +4,7 @@ # General config errors [10-19] ELOAD=10 EINTERVAL=11 +ENOCFG=19 # Source cofig errors [20-29] # Destination config errors [30-49] EFORMAT=30 @@ -26,6 +27,9 @@ declare -A \ exit $EBASHVERS } +DOCDIR=./doc +exampleconf=$DOCDIR/example.cfg + #parse arguments #parse config getConfigGeneral() { @@ -278,6 +282,23 @@ transcodeLauncher() { } #UI + +if [ ! -f ~/.atom/atom.cfg ] +then + if [ ! -d ~/.atom ] + then + mkdir -p ~/.atom + fi + sed "s/%HOME%/$HOME/" "$exampleconf" ~/.atom/atom.cfg + cat >&2 <<-EOCfgNotice + No configuration file found! + An example file has been created as ~/.atom/atom.cfg. + You should change it to your likings using you favorite editor. + + Bailing out. + EOCfgNotice + exit $ENOCFG +fi getConfig { cat <