#!/bin/sh

if [ ! -f $HOME/.fterc ]
then
    # Is there a .fte/mymain.fte ?  If not, create it.
    if [ ! -f $HOME/.fte/mymain.fte ]
    then
        if [ ! -d $HOME/.fte ]
        then
            mkdir $HOME/.fte
        fi
    	cp /usr/local/share/fte/config/mymain.fte $HOME/.fte/mymain.fte
    fi
    (cd /usr/local/share/fte/config; /usr/local/bin/cfte mymain.fte $HOME/.fterc) || exit 1
fi

exec /usr/local/bin/xfte "$@"
