From 39ad42a3bb153d11d7cddc6b01783a34e44e1bda Mon Sep 17 00:00:00 2001 From: BitMaster Admin Date: Thu, 19 Jun 2025 13:23:05 +0000 Subject: [PATCH] Update install.sh --- install.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 4938a0f..cde8396 100644 --- a/install.sh +++ b/install.sh @@ -125,8 +125,21 @@ function clone_and_build() { read -rp "$(echo -e "${GREEN}🔁 Press Enter to return to the main menu...${NC}")" } -# All other functions (system_status, enable_logging, setup_cronjob, show_cronjobs, remove_cronjob, run_bot_once) -# remain unchanged and are already defined above. +function run_bot_once() { + echo -e "${YELLOW}🔍 Checking bot status...${NC}" + if [ ! -f "$CLONE_DIR/bot.py" ]; then + echo -e "${RED}❌ Bot not installed. Please run option 1 first.${NC}" + else + echo -e "${GREEN}📤 Running the bot in Docker to send test message...${NC}" + docker compose -f "$CLONE_DIR/docker-compose.yml" run --rm "$CRON_NAME" + if [ $? -eq 0 ]; then + echo -e "${GREEN}✅ Bot ran successfully. Check your Telegram!${NC}" + else + echo -e "${RED}❌ Bot failed to run. Check Docker logs or credentials.${NC}" + fi + fi + read -rp "$(echo -e "${GREEN}🔁 Press Enter to return to the main menu...${NC}")" +} # -- Start script loop -- while true; do