-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathqrius.sh
More file actions
executable file
·28 lines (22 loc) · 845 Bytes
/
qrius.sh
File metadata and controls
executable file
·28 lines (22 loc) · 845 Bytes
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
#!/bin/bash
# Qrius launch script
LOGFILE=${HOME}/.quazar/Qrius/log/`date +%Y%m%d`.log
LLOGFILE=${HOME}/.quazar/Qrius/latest.log
get_topdir(){
local _SCRIPT_PATH=`realpath "${BASH_SOURCE[0]}"`
local _SCRIPT_FOLDER=`dirname "${_SCRIPT_PATH}"`
local _TOP_DIR=`realpath "${_SCRIPT_FOLDER}"`
eval $1="${_TOP_DIR}"
}
TOP_DIR=''
get_topdir TOP_DIR
dirname ${LOGFILE} | xargs mkdir -p
touch ${LOGFILE}
ln -nsf ${LOGFILE} ${LLOGFILE}
echo | tee -a ${LOGFILE}
echo '+++++++++++++++++++++++++++++++++++++' | tee -a ${LOGFILE}
date | tee -a ${LOGFILE}
echo '+++++++++++++++++++++++++++++++++++++' | tee -a ${LOGFILE}
echo | tee -a ${LOGFILE}
stdbuf --output=L --error=L \
python2 ${TOP_DIR}/main.py 2>&1 | tee -a ${LOGFILE}