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

Function get_status

webapp_modern.py:4836–4880  ·  view source on GitHub ↗

Get current Ragnar status (optimized - uses cached data from background sync)

()

Source from the content-addressed store, hash-verified

4834
4835 # Component-level validation: distinguish "fully installed" from a partial or
4836 # broken install so the dashboard can offer a Repair button.
4837 health = _pwnagotchi_component_health()
4838 status['components'] = health['components']
4839 status['component_labels'] = health['component_labels']
4840 status['component_order'] = health['component_order']
4841 status['missing_critical'] = health['missing_critical']
4842 status['missing_optional'] = health['missing_optional']
4843 status['healthy'] = health['healthy']
4844
4845 # Self-heal a stuck status: if every component is present and no installer
4846 # process is running, the install is done even when the status file was left
4847 # mid-flight — e.g. the installer was killed right before writing its terminal
4848 # "installed" state, or a stale file lingers. Without this the UI stays pinned
4849 # to "installing" until the 10-minute stale timeout (and disables the swap).
4850 if (
4851 status['state'] in {'installing', 'error', 'not_installed'}
4852 and health['healthy']
4853 and not status['service_active']
4854 and not _pwn_install_process_running()
4855 ):
4856 status['installing'] = False
4857 status['state'] = 'installed'
4858 status['phase'] = 'complete'
4859 status['message'] = 'Pwnagotchi installed successfully. Use the Ragnar dashboard to launch.'
4860 status['installed'] = True
4861 _write_pwn_status_file('installed', status['message'], 'complete', {
4862 'target_mode': status.get('target_mode', 'ragnar'),
4863 'service_state': status.get('service_state'),
4864 })
4865
4866 status['needs_repair'] = bool(
4867 status['installed'] and not health['healthy'] and not status['installing']
4868 )
4869
4870 config_updates = {}
4871 if status['installed'] != bool(shared_data.config.get('pwnagotchi_installed', False)):
4872 config_updates['pwnagotchi_installed'] = status['installed']
4873
4874 if status.get('mode') and status['mode'] != shared_data.config.get('pwnagotchi_mode'):
4875 config_updates['pwnagotchi_mode'] = status['mode']
4876
4877 if status.get('message') and status['message'] != shared_data.config.get('pwnagotchi_last_status'):
4878 config_updates['pwnagotchi_last_status'] = status['message']
4879
4880 if persist and config_updates:
4881 _update_pwn_config(config_updates)
4882
4883 status['discoveries'] = _collect_pwnagotchi_discovery_summary()

Callers

nothing calls this directly

Calls 11

is_ethernet_availableFunction · 0.90
safe_strFunction · 0.85
is_orchestrator_runningFunction · 0.85
safe_intFunction · 0.85
safe_boolFunction · 0.85
get_current_wifi_ssidFunction · 0.85
_get_active_ethernet_ipFunction · 0.85
errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected