#!/bin/bash
## Directory where zhe zbnfjax-folder will be copied
DST="/usr/share/vishia"
## Directory where the zbnfjax-shell command will be copied
BATDST="/usr/bin"
echo This setup will install the 'ZBNF/zbnfjax' directory tree on $DST/zbnfjax 
echo and the 'zbnfjax\batch_template\zbnfjax'-shell file on $BATDST
echo If it is not desired, please edit this file
echo
echo Hint: This batch works only correct if you have access rights. 
echo Execute it as root.
if test ! -d $DST; then mkdir $DST; fi
## remove exisiting folder because it may be confuse.
if test -d $DST/zbnfjax; then rm -r $DST/zbnfjax; fi
cp -r ../zbnfjax $DST
## Copy an existing $BATDST/zbnfjax-script as zbnfjax_old, because there may be some user changes.
if test -f $BATDST/zbnfjax_old; then rm $BATDST/zbnfjax_old; fi 
if test -f $BATDST/zbnfjax; then mv -f $BATDST/zbnfjax $BATDST/zbnfjax_old; fi 

cp -f ../zbnfjax/batch_template/zbnfjax $BATDST/zbnfjax
echo done.
