#61 Simple conditions in cofig file

closed
nobody
5
2010-03-13
2009-11-12
Anonymous
No

Sometimes one or another option in config file depends of command line parameters or other options in config file. It will be usefull to add condional processing of options:
if $CONSOLE == 'fltk' # $CONSOLE - predefined variable with name of console from -t <...>
cocon=150x65
else
cocon=150x69
endif

Discussion

  • Henry N.
    Henry N.
    2009-11-12

    For this move the cocon into the batch from where you should set also fltk or nt.

    for example FLTK.BAT:
    colinux_daemon -t fltk cocon=150x65 @colinux.conf
    and the other NT.BAT:
    colinux_daemon -t nt cocon=150x69 @colinux.conf

     
  • Henry N.
    Henry N.
    2010-03-13

    This is doable also without IF conditions.
    Simple move the conditions from inside config file to the command line, for example:
    A) colinux-daemon -t fltk cocon=150x65 @colinux.conf
    B) colinux-daemon -t nt cocon=150x69 @colinux.conf

    Or, create 3 configs.
    colinux-basic.conf : with all your stuff
    colinux-fltk.conf : with options only in fltk console
    colinux-nt.conf : with options only for nt console

    Than run two different versions from batch or shortcut:
    A) colinux-daemon -t fltk @colinux-fltk.conf @colinux-basic.conf
    B) colinux-daemon -t nt @colinux-nt.conf @colinux-basic.conf

     
  • Henry N.
    Henry N.
    2010-03-13

    • status: open --> closed