2
0
mirror of https://github.com/ComradCollective/Comrad synced 2024-11-17 21:25:37 +00:00
Comrad/bin/komrade-op

34 lines
600 B
Plaintext
Raw Normal View History

2020-09-14 13:10:14 +00:00
##
# Run THE OPERATOR
##
2020-09-15 08:51:52 +00:00
export KOMRADE_SHOW_LOG=1
2020-09-14 16:17:50 +00:00
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
2020-09-14 13:06:50 +00:00
path=`realpath "$SCRIPTPATH/../komrade/backend/switchboard.py"`
pathvenv=`realpath "$SCRIPTPATH/../venv/bin/activate"`
source $pathvenv
2020-09-14 22:39:10 +00:00
date=$(date '+%Y-%m-%d')
2020-09-14 22:44:33 +00:00
pathlog="$SCRIPTPATH/../../data/log"
mkdir -p "$pathlog"
fnfn="$pathlog/$date.op.log"
2020-09-14 13:06:50 +00:00
2020-09-14 22:41:46 +00:00
#echo $pathlog
2020-09-14 22:39:10 +00:00
2020-09-14 22:52:19 +00:00
cmd="python $path 8080 $*"
2020-09-14 13:06:50 +00:00
2020-09-14 13:10:14 +00:00
# do forever
2020-09-14 22:52:19 +00:00
while true; do $cmd && break; done
2020-09-14 13:06:50 +00:00
2020-09-14 22:52:19 +00:00
#python $path 8080 $* >> $fnfn 2>&1
2020-09-14 16:47:39 +00:00
2020-09-14 22:47:34 +00:00
echo $path
echo $fnfn
2020-09-14 22:39:10 +00:00
#if command -v deactivate &> /dev/null
#then
# deactivate
#fi