# Auto-print fortune after user login
#
# Everything in file ~/.fortune will be interpreted as command
# parameters for fortune. Possible value are:
#    none                        - disable fortune
#    <nothing>                   - use defaults
#    /usr/share/games/fortune    - use this directory
#    /usr/share/games/fortune/cs - use this directory
#    cs                          - use default + cs (like above)
#
# To disable fortune, create ~/.fortune with single word `none'.

#
# Automaticky vypis fortune pri prihlaseni uzivatele
#
# Vsechno v souboru ~/.fortune bude interpretovano jako parametry
# prikazu fortune. Mozne hodnoty jsou:
#    none                        - zakazat fortune
#    <nothing>                   - pouzit implicitni hodnoty
#    /usr/share/games/fortune    - pouzite tento adresar
#    /usr/share/games/fortune/cs - pouzite tento adresar
#    cs                          - pouzit implicitni + cs (jako o radek vyse)
#
# Pro zakazani fortune, vytvorte si v domacim adresari soubor ~/.fortune,
# ktery bude obsahovat pouze slovo `none'.

set FORTUNEPARAMS = ""
if ( -r ~/.fortune ) then
  set FORTUNEPARAMS = `cat ~/.fortune`
endif
if (( "$FORTUNEPARAMS" != "none" ) && \
    ( "$TERM" != "dumb" )          && \
    ( -x /usr/bin/fortune )        && \
    ( -x /usr/bin/tty )            && \
    ( "$USER" != "postgres" )) then
  /usr/bin/tty | grep -q not
  if ( $status == 1 ) then
    echo
    /usr/bin/fortune $FORTUNEPARAMS
    echo
  endif
endif
unset FORTUNEPARAMS
