#!/bin/bash # Build script for Raspberry Pi 5 # This script installs dependencies and builds the wireless monitor tool set -e echo "=== Wireless Monitor - Raspberry Pi 5 Build ===" echo "" # Check if running on Raspberry Pi (optional check) if [ -f /proc/device-tree/model ] && grep -q "Raspberry Pi" /proc/device-tree/model 2>/dev/null; then echo "Detected Raspberry Pi" cat /proc/device-tree/model echo "" fi # Check for root (needed for some package checks, but not for building) if [ "$EUID" -eq 0 ]; then echo "Warning: Running as root. Building as regular user is recommended." echo "" fi # Install dependencies echo "=== Installing Dependencies ===" sudo apt-get update sudo apt-get install -y \ build-essential \ autoconf \ automake \ libtool \ pkg-config \ libpcap-dev \ libnl-genl-3-dev \ libnl-3-dev echo "" echo "=== Building ===" # Generate configure script if [ ! -f configure ]; then echo "Running autogen.sh..." ./autogen.sh fi # Configure if [ ! -f Makefile ]; then echo "Running configure..." ./configure fi # Build echo "Running make..." make echo "" echo "=== Build Complete ===" echo "" echo "Binary location: ./src/wireless_monitor" echo "" echo "To test (requires root for monitor mode):" echo " sudo ./src/wireless_monitor wlan0 11" echo "" echo "To install system-wide:" echo " sudo make install"