-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
69 lines (63 loc) · 1.89 KB
/
setup.sh
File metadata and controls
69 lines (63 loc) · 1.89 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
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# NetGuard DNS Monitor - Linux/macOS Setup Script
# Automated installation for Unix-like systems
echo ""
echo "================================================================"
echo ""
echo " NetGuard DNS Monitor - Linux/macOS Setup"
echo ""
echo "================================================================"
echo ""
# Check Python installation
if ! command -v python3 &> /dev/null; then
echo "❌ ERROR: Python 3 is not installed"
echo "Please install Python 3.8+ using your package manager"
exit 1
fi
echo "✅ [1/4] Python detected successfully"
echo ""
# Create virtual environment
echo "📦 [2/4] Creating virtual environment..."
if [ -d "venv" ]; then
echo "Virtual environment already exists. Skipping..."
else
python3 -m venv venv
if [ $? -ne 0 ]; then
echo "❌ ERROR: Failed to create virtual environment"
exit 1
fi
echo "✅ Virtual environment created successfully"
fi
echo ""
# Activate virtual environment and install dependencies
echo "📥 [3/4] Installing dependencies..."
source venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
if [ $? -ne 0 ]; then
echo "❌ ERROR: Failed to install dependencies"
exit 1
fi
echo "✅ Dependencies installed successfully"
echo ""
# Setup complete
echo "🎉 [4/4] Setup complete!"
echo ""
echo "================================================================"
echo ""
echo " Setup Complete! Next Steps:"
echo ""
echo " 1. Activate virtual environment:"
echo " source venv/bin/activate"
echo ""
echo " 2. Run NetGuard (with sudo):"
echo " sudo python3 main.py"
echo ""
echo " 3. Configure device DNS settings"
echo " - Set Primary DNS to your computer's IP"
echo " - Set Secondary DNS to 8.8.8.8"
echo ""
echo " Read QUICK_SETUP.md for more details"
echo ""
echo "================================================================"
echo ""