custom-scripts/bot-control

157 lines
5.7 KiB
Plaintext
Raw Normal View History

2024-09-25 21:43:32 +00:00
#!/bin/bash
# Path variables
NODBOT_PATH="/srv/docker/nodbot"
NODBOT_PE_PATH="/srv/docker/nodbot-pe"
SILVANUS_PATH="/srv/docker/silvanus"
SILVANUS_FE_PATH="/srv/docker/silvanus-fe"
# Check for root or docker group
if [ "$EUID" -ne 0 ] && [ -z "$(groups | grep docker)" ]; then
echo "Please run as root or add user to docker group"
exit
fi
# Prompt for input
echo "##########################################"
echo "# Bot Control Panel #"
echo "##########################################"
echo "# 1. NodBot #"
echo "# 2. NodBot PE #"
echo "# 3. Silvanus #"
echo "# 4. Silvanus FE #"
echo "##########################################"
# Read user input
read -p "Enter your choice: " choice
# Switch case on input
case $choice in
1)
2024-09-25 21:45:24 +00:00
clear
2024-09-25 21:43:32 +00:00
echo "Selecting NodBot..."
echo "##########################################"
echo "# 1. Start NodBot #"
echo "# 2. Stop NodBot #"
echo "# 3. Restart NodBot #"
echo "# 4. View NodBot Logs #"
echo "##########################################"
# Read user input
read -p "Enter your choice: " nodbot_choice
case $nodbot_choice in
1)
echo "Starting NodBot..."
docker-compose -f $NODBOT_PATH/docker-compose.yml up -d
;;
2)
echo "Stopping NodBot..."
docker-compose -f $NODBOT_PATH/docker-compose.yml down
;;
3)
echo "Restarting NodBot..."
docker-compose -f $NODBOT_PATH/docker-compose.yml down
docker-compose -f $NODBOT_PATH/docker-compose.yml up -d
;;
4)
echo "Viewing NodBot Logs..."
docker-compose -f $NODBOT_PATH/docker-compose.yml logs -f
;;
esac
;;
2)
2024-09-25 21:45:24 +00:00
clear
2024-09-25 21:43:32 +00:00
echo "Selecting NodBot PE..."
echo "##########################################"
echo "# 1. Start NodBot PE #"
echo "# 2. Stop NodBot PE #"
echo "# 3. Restart NodBot PE #"
echo "# 4. View NodBot PE Logs #"
echo "##########################################"
# Read user input
read -p "Enter your choice: " nodbot_pe_choice
case $nodbot_pe_choice in
1)
echo "Starting NodBot PE..."
docker-compose -f $NODBOT_PE_PATH/docker-compose.yml up -d
;;
2)
echo "Stopping NodBot PE..."
docker-compose -f $NODBOT_PE_PATH/docker-compose.yml down
;;
3)
echo "Restarting NodBot PE..."
docker-compose -f $NODBOT_PE_PATH/docker-compose.yml down
docker-compose -f $NODBOT_PE_PATH/docker-compose.yml up -d
;;
4)
echo "Viewing NodBot PE Logs..."
docker-compose -f $NODBOT_PE_PATH/docker-compose.yml logs -f
;;
esac
;;
3)
2024-09-25 21:45:24 +00:00
clear
2024-09-25 21:43:32 +00:00
echo "Selecting Silvanus..."
echo "##########################################"
echo "# 1. Start Silvanus #"
echo "# 2. Stop Silvanus #"
echo "# 3. Restart Silvanus #"
echo "# 4. View Silvanus Logs #"
echo "##########################################"
# Read user input
read -p "Enter your choice: " silvanus_choice
case $silvanus_choice in
1)
echo "Starting Silvanus..."
docker-compose -f $SILVANUS_PATH/docker-compose.yml up -d
;;
2)
echo "Stopping Silvanus..."
docker-compose -f $SILVANUS_PATH/docker-compose.yml down
;;
3)
echo "Restarting Silvanus..."
docker-compose -f $SILVANUS_PATH/docker-compose.yml down
docker-compose -f $SILVANUS_PATH/docker-compose.yml up -d
;;
4)
echo "Viewing Silvanus Logs..."
docker-compose -f $SILVANUS_PATH/docker-compose.yml logs -f
;;
esac
;;
4)
2024-09-25 21:45:24 +00:00
clear
2024-09-25 21:43:32 +00:00
echo "Selecting Silvanus FE..."
echo "##########################################"
echo "# 1. Start Silvanus FE #"
echo "# 2. Stop Silvanus FE #"
echo "# 3. Restart Silvanus FE #"
echo "# 4. View Silvanus FE Logs #"
echo "##########################################"
# Read user input
read -p "Enter your choice: " silvanus_fe_choice
case $silvanus_fe_choice in
1)
echo "Starting Silvanus FE..."
docker-compose -f $SILVANUS_FE_PATH/docker-compose.yml up -d
;;
2)
echo "Stopping Silvanus FE..."
docker-compose -f $SILVANUS_FE_PATH/docker-compose.yml down
;;
3)
echo "Restarting Silvanus FE..."
docker-compose -f $SILVANUS_FE_PATH/docker-compose.yml down
docker-compose -f $SILVANUS_FE_PATH/docker-compose.yml up -d
;;
4)
echo "Viewing Silvanus FE Logs..."
docker-compose -f $SILVANUS_FE_PATH/docker-compose.yml logs -f
;;
esac
;;
*)
echo "Invalid choice"
;;
esac