-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·74 lines (56 loc) · 1.61 KB
/
setup.sh
File metadata and controls
executable file
·74 lines (56 loc) · 1.61 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
70
71
72
73
74
#!/usr/bin/env bash
RED_BOLD='\033[1;31m'
YELLOW_BOLD='\033[1;33m'
GREEN_BOLD='\033[1;32m'
RESET='\033[0m'
set -euo pipefail
PROJECT_NAME="framesniff"
VENV_DIR=".venv"
VENV_PYTHON="$VENV_DIR/bin/python"
print_step() {
echo
echo "==> $1"
}
print_ok() {
echo "✔ $1"
}
print_error() {
echo "✖ $1"
exit 1
}
print_step "Checking required system dependencies..."
for pkg in python iw; do
if ! command -v "$pkg" >/dev/null 2>&1; then
print_error "Missing dependency: $pkg"
fi
done
print_ok "All required system dependencies are available."
print_step "Setting up virtual environment..."
if [ ! -d "$VENV_DIR" ]; then
python3 -m venv "$VENV_DIR"
print_ok "Virtual environment created."
else
print_ok "Virtual environment already exists."
fi
source "$VENV_DIR/bin/activate"
print_step "Upgrading pip..."
python -m pip install --upgrade pip >/dev/null
print_step "Installing dependencies..."
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
print_ok "Dependencies installed."
else
print_error "requirements.txt not found."
fi
print_step "Setup completed successfully!"
echo
echo -e "${YELLOW_BOLD}========================================${RESET}"
echo -e "${RED_BOLD}IMPORTANT:${RESET}"
echo -e "${RED_BOLD}Use the Python interpreter inside:${RESET}"
echo -e "${GREEN_BOLD}$VENV_PYTHON${RESET}"
echo -e "${YELLOW_BOLD}========================================${RESET}"
echo
echo -e "${YELLOW_BOLD}Run normally:${RESET}"
echo -e " ${GREEN_BOLD}source $VENV_DIR/bin/activate${RESET}"
echo -e " ${GREEN_BOLD}sudo $VENV_PYTHON framesniff.py --help${RESET}"
echo