-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathstartEego.sh
executable file
·47 lines (45 loc) · 1.32 KB
/
startEego.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /usr/bin/env bash
cd `dirname "${BASH_SOURCE[0]}"`
buffdir="$( pwd )"
echo $buffdir
exedir=${buffdir}/buffer
buffexe=eego2ft;
if [ `uname -s` == 'Linux' ]; then
if [[ `uname -m` =~ arm* ]]; then
# rapsberry pi
if [ -r $buffdir/buffer/raspberrypi/$bufexe ]; then
exedir=$buffdir'/buffer/raspberrypi';
else
echo ERROR
fi
else # x86 linux
if [ -r $buffdir/buffer/bin/glnx86/$buffexe ]; then
exedir=$buffdir'/buffer/bin/glnx86';
fi
if [ -r $buffdir/buffer/glnx86/$buffexe ]; then
exedir=$buffdir'/buffer/glnx86';
fi
fi
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${exedir}
else # Mac
if [ -r $buffdir/buffer/bin/maci/$buffexe ]; then
exedir=$buffdir/buffer/bin/maci
fi
if [ -r $buffdir/buffer/maci/$buffexe ]; then
exedir=$buffdir/buffer/maci
fi
# add exec directory to library load path
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${exedir}
fi
#identify the config file to use
if [ -r ${buffdir}/${buffexe%2ft}.cfg ]; then
configFile=${buffdir}/${buffexe%2ft}.cfg
else
configFile=-
fi
${exedir}/${buffexe} ${configFile} $*
if [ $? == 1 ] ; then
echo Couldnt start the AMP driver. Possible reasons
echo 1\) The amplifier isnt connected or turned on?
echo 2\) You cannot read the USB device. On linux try: sudo ./${BASH_SOURCE[0]}
fi