Update install.sh
This commit is contained in:
36
install.sh
36
install.sh
@@ -132,39 +132,11 @@ function run_bot_once() {
|
||||
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
|
||||
status=$?
|
||||
if [ $status -eq 0 ]; then
|
||||
echo -e "${GREEN}✅ Bot ran successfully. Check your Telegram!${NC}"
|
||||
elif [ $status -eq 137 ]; then
|
||||
echo -e "${RED}⚠️ Bot was terminated early. It may have been interrupted (e.g., Ctrl+C).${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
|
||||
clear
|
||||
banner
|
||||
system_status
|
||||
echo -e "${YELLOW}1. Install bot (clone + build)"
|
||||
echo -e "2. Check bot status + send test Telegram message"
|
||||
echo -e "3. Enable .log file logging"
|
||||
echo -e "4. Setup new cronjob (every X min)"
|
||||
echo -e "5. Show current cronjobs"
|
||||
echo -e "6. Remove existing cronjob"
|
||||
echo -e "7. Exit${NC}"
|
||||
echo ""
|
||||
read -rp "$(echo -e "${YELLOW}🔗 Choose [1-7]: ${NC}")" choice
|
||||
|
||||
case $choice in
|
||||
1) clone_and_build ;;
|
||||
2) run_bot_once ;;
|
||||
3) enable_logging ;;
|
||||
4) setup_cronjob ;;
|
||||
5) show_cronjobs ;;
|
||||
6) remove_cronjob ;;
|
||||
7) echo -e "${RED}❌ Exiting...${NC}"; exit 0 ;;
|
||||
*) echo -e "${RED}❌ Invalid option.${NC}"; sleep 1 ;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user