Kuby/gerer_bot.sh

12 lines
268 B
Bash
Raw Normal View History

#!/bin/bash
ROLE=$(./verifier_role_db.sh)
BOT_TOURNE=$(docker ps -q -f name=bot-discord)
if [ "$ROLE" = "primary" ] && [ -z "$BOT_TOURNE" ]; then
docker start bot-discord
fi
if [ "$ROLE" = "replica" ] && [ -n "$BOT_TOURNE" ]; then
docker stop bot-discord
fi