You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Comrad/bin/komrade-op

34 lines
575 B
Plaintext

4 years ago
##
# Run THE OPERATOR
##
4 years ago
4 years ago
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4 years ago
path=`realpath "$SCRIPTPATH/../komrade/backend/switchboard.py"`
pathvenv=`realpath "$SCRIPTPATH/../venv/bin/activate"`
source $pathvenv
4 years ago
date=$(date '+%Y-%m-%d')
4 years ago
pathlog="$SCRIPTPATH/../../data/log"
mkdir -p "$pathlog"
fnfn="$pathlog/$date.op.log"
4 years ago
4 years ago
#echo $pathlog
4 years ago
4 years ago
cmd="python $path 8080 $*"
4 years ago
4 years ago
# do forever
4 years ago
while true; do $cmd && break; done
4 years ago
4 years ago
#python $path 8080 $* >> $fnfn 2>&1
4 years ago
4 years ago
echo $path
echo $fnfn
4 years ago
#if command -v deactivate &> /dev/null
#then
# deactivate
#fi