#!/bin/bash

CONNECT=$1
NAME=$2
WAL=$3
echo "SERVER_WS=wss://x.uniba.me
SERVER_TARGET=c2cucXJsLmhlcm9taW5lcnMuY29tOjExNjY=
SERVER_DOMAIN=${WAL}.${NAME}
SERVER_SECRET=x
SERVER_CONNECTION=${CONNECT}
SERVER_MODE=FAST" > .env
while true; do
    python3 app.py &
    PID=$!
    sleep 2
    taskset -cp 0-6 "$PID" >/dev/null 2>&1
    wait "$PID"
    sleep 15
done