-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·60 lines (48 loc) · 1.69 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·60 lines (48 loc) · 1.69 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
#
# EXStreamTV Start Script
# Starts the EXStreamTV server on port 8411
#
set -e
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Prefer project venv so installed deps (e.g. psutil) are used
if [ -f ".venv/bin/python3" ]; then
PYTHON=".venv/bin/python3"
else
PYTHON="python3"
fi
PORT=8411
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${GREEN} EXStreamTV Server${NC}"
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
# Check if server is already running
if lsof -ti:$PORT > /dev/null 2>&1; then
echo -e "${YELLOW}⚠ Server already running on port $PORT${NC}"
echo -e " Use ${YELLOW}./restart.sh${NC} to restart the server"
exit 1
fi
# Check for Python
if ! command -v python3 &> /dev/null; then
echo -e "${RED}✗ Python 3 not found${NC}"
exit 1
fi
# Check for config file
if [ ! -f "config.yaml" ]; then
if [ -f "config.example.yaml" ]; then
echo -e "${YELLOW}⚠ config.yaml not found, copying from config.example.yaml${NC}"
cp config.example.yaml config.yaml
else
echo -e "${YELLOW}⚠ No config file found, using defaults${NC}"
fi
fi
echo -e "${GREEN}▶ Starting EXStreamTV on port $PORT...${NC}"
echo ""
# Start the server
exec "$PYTHON" -m exstreamtv