-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_linux.sh
executable file
·56 lines (49 loc) · 757 Bytes
/
run_linux.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
48
49
50
51
52
53
54
55
56
#!/bin/sh
DIR=$(dirname $(readlink -f "${0}"))
MACHINE_NAME=`uname -m`
case ${MACHINE_NAME} in
i486|i586|i686)
MACHINE_NAME=32
;;
x86_64)
MACHINE_NAME=64
;;
*)
MACHINE_NAME=
;;
esac
SYSTEM_NAME=`uname -s`
case ${SYSTEM_NAME} in
Linux)
SYSTEM_NAME=linux
;;
*)
SYSTEM_NAME=unknown_
;;
esac
if [ $1 ]
then
if [ -f $1 ]
then
SCRIPT=$1
else
SCRIPT=main.lua
fi
else
SCRIPT=main.lua
fi
HAS_ZENITY=`whereis -b zenity | grep usr | wc -l`
if [ $HAS_ZENITY -eq 1 ]
then
MSG='zenity --info --text'
else
MSG=echo
fi
if [ -x ${DIR}/bin/${SYSTEM_NAME}${MACHINE_NAME}/luajit ]
then
cd ${DIR}
./bin/${SYSTEM_NAME}${MACHINE_NAME}/luajit $SCRIPT $*
else
$MSG "Your platform does not have a pre-compiled Cheetah engine."
exit 1
fi