mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Add gr-gsm and tshark as auto-installed dependencies
GSM Spy was failing with FileNotFoundError because grgsm_scanner wasn't installed. These tools are now installed automatically by setup.sh (both Debian and macOS) and included in the Dockerfile, matching how other tools like multimon-ng and ffmpeg are handled. - setup.sh: Remove ask_yes_no prompts for gr-gsm and tshark, install unconditionally; add check_recommended tier for final summary - Dockerfile: Add tshark to apt layer, add gr-gsm RUN layer with apt-then-source-build fallback, preseed debconf for tshark - gsm_spy.py: Add shutil.which pre-check in start_scanner route, catch FileNotFoundError in scanner_thread to stop retry loop Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import json
|
||||
import logging
|
||||
import queue
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import threading
|
||||
import time
|
||||
@@ -361,6 +362,11 @@ def start_scanner():
|
||||
|
||||
# Build grgsm_scanner command
|
||||
# Example: grgsm_scanner --args="rtl=0" -b GSM900
|
||||
if not shutil.which('grgsm_scanner'):
|
||||
from app import release_sdr_device
|
||||
release_sdr_device(device_index)
|
||||
return jsonify({'error': 'grgsm_scanner not found. Please install gr-gsm.'}), 500
|
||||
|
||||
try:
|
||||
cmd = ['grgsm_scanner']
|
||||
|
||||
@@ -1325,6 +1331,22 @@ def scanner_thread(cmd, device_index):
|
||||
|
||||
logger.info(f"Scan #{scan_count} complete")
|
||||
|
||||
except FileNotFoundError:
|
||||
logger.error(
|
||||
"grgsm_scanner not found. Please install gr-gsm: "
|
||||
"https://github.com/ptrkrysik/gr-gsm"
|
||||
)
|
||||
# Send error to SSE stream so the UI knows
|
||||
try:
|
||||
app_module.gsm_spy_queue.put({
|
||||
'type': 'error',
|
||||
'message': 'grgsm_scanner not found. Please install gr-gsm.',
|
||||
'timestamp': time.strftime('%Y-%m-%dT%H:%M:%S')
|
||||
})
|
||||
except Exception:
|
||||
pass
|
||||
break # Don't retry - binary won't appear
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Scanner scan error: {e}", exc_info=True)
|
||||
if process and process.poll() is None:
|
||||
|
||||
Reference in New Issue
Block a user