-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·40 lines (32 loc) · 871 Bytes
/
run.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
#!/usr/bin/env bash
export APP_HOME=~/.btc-register
export KIVY_HOME=~/.btc-register/kivy
export KIVY_GL_BACKEND='gl' # [issue #6007](https://github.com/kivy/kivy/issues/6007)
BASE_DIR=$(cd $(dirname $0); pwd)
RESTART_FILE=${APP_HOME}/.restart
SHUTDOWN_FILE=${APP_HOME}/.shutdown
# config file
mkdir -p ${APP_HOME}
mkdir -p ${KIVY_HOME}
if [[ ! -f ${KIVY_HOME}/config.ini ]]; then
cp ${BASE_DIR}/config/kivy_default.ini ${KIVY_HOME}/config.ini
fi
# Restart run.py if `.restart` file exists.
enable_loop=true
while ${enable_loop}
do
if [[ -f ${RESTART_FILE} ]]; then
rm ${RESTART_FILE}
fi
if [[ -f ${SHUTDOWN_FILE} ]]; then
rm ${SHUTDOWN_FILE}
fi
python3 ${BASE_DIR}/run.py
if [[ ! -f ${RESTART_FILE} ]]; then
enable_loop=false
fi
done
# shutdown
if [[ -f ${SHUTDOWN_FILE} ]]; then
sudo shutdown now
fi