MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / get_nmap_ping_scan

Function get_nmap_ping_scan

webapp_modern.py:8715–8742  ·  view source on GitHub ↗

Get nmap ping scan results

()

Source from the content-addressed store, hash-verified

8713 The toggle only acts on a *change*, so a box whose config already says
8714 kiosk_enabled - an install that failed halfway, a restored config, a unit
8715 that was removed by hand - had no way back: turning the switch on when it is
8716 already on does nothing. That is what left people running
8717 `sudo bash scripts/install_kiosk.sh` themselves. This is that command,
8718 automated, with the enable step included.
8719 """
8720 capable, reason = _kiosk_capability()
8721 if not capable:
8722 logger.warning(f"[kiosk] repair refused: {reason}")
8723 return jsonify({'success': False, 'error': reason}), 403
8724
8725 task = _kiosk_task_get()
8726 if task.get('busy'):
8727 return jsonify({'success': False,
8728 'error': f"A kiosk job is already running ({task.get('phase')})."}), 409
8729
8730 def worker():
8731 _kiosk_task_set(busy=True, phase='installing', error=None, started=time.time())
8732 try:
8733 _kiosk_install_and_start()
8734 except subprocess.TimeoutExpired:
8735 logger.error("[kiosk] repair timed out")
8736 _kiosk_task_set(phase='failed', error='Kiosk repair timed out.')
8737 except Exception as exc:
8738 logger.error(f"[kiosk] repair error: {exc}")
8739 _kiosk_task_set(phase='failed', error=str(exc))
8740 finally:
8741 with _kiosk_task_lock:
8742 _kiosk_task['busy'] = False
8743
8744 # Remember the intent, so a reboot mid-repair still comes up with the kiosk.
8745 if not shared_data.config.get('kiosk_enabled'):

Callers

nothing calls this directly

Calls 4

_detect_local_cidrFunction · 0.85
run_nmap_ping_scanFunction · 0.85
errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected