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

27 lines
488 B
Plaintext
Raw Normal View History

2020-09-14 13:10:14 +00:00
##
# Run THE OPERATOR
##
2020-09-14 13:06:50 +00:00
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:41:46 +00:00
pathlog="$SCRIPTPATH/../log/$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
cmd="python $path 8080 $* >> $pathlog 2>&1"
2020-09-14 13:06:50 +00:00
2020-09-14 13:10:14 +00:00
# do forever
2020-09-14 13:10:52 +00:00
while true; do $cmd && break; done
2020-09-14 13:06:50 +00:00
2020-09-14 16:47:39 +00:00
2020-09-14 22:39:10 +00:00
#if command -v deactivate &> /dev/null
#then
# deactivate
#fi