-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart
More file actions
executable file
·42 lines (35 loc) · 926 Bytes
/
start
File metadata and controls
executable file
·42 lines (35 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
echo "🚀 Starting RSS-ify..."
echo "======================================"
# Update repository if -c flag is provided
update_repo() {
echo "📦 Updating repository..."
git stash
git pull --force
git submodule update --init --recursive
echo "✅ Repository updated"
}
if [[ "$1" == "-c" ]]; then
update_repo
fi
# Install Node.js dependencies
echo "📦 Installing Node.js dependencies..."
npm install || {
echo "❌ Failed to install Node.js dependencies."
exit 1
}
echo "✅ Node.js dependencies installed"
# Activate venv if it exists
if [ -d "api/venv" ]; then
echo "🔧 Activating virtual environment..."
source api/venv/bin/activate
fi
# Start the bot
echo "🤖 Starting Telegram Bot..."
node bot.mjs
# Cleanup: Kill all background processes
echo ""
echo "🛑 Shutting down..."
kill $API_PID 2>/dev/null
pkill -P $$ 2>/dev/null
echo "✅ Cleanup complete"