Start a background thread that watches for WiFi interface disappearance.
(self)
| 605 | try: |
| 606 | state_file = '/tmp/ragnar_wifi_state.json' |
| 607 | if os.path.exists(state_file): |
| 608 | os.remove(state_file) |
| 609 | except Exception as e: |
| 610 | self.logger.warning(f"Could not clean up connection state: {e}") |
| 611 | |
| 612 | def _create_restart_marker(self): |
| 613 | """Create a marker file to help detect service restarts""" |
| 614 | try: |
| 615 | marker_file = '/tmp/ragnar_wifi_manager.pid' |
| 616 | with open(marker_file, 'w') as f: |
| 617 | f.write(f"{os.getpid()}\n{time.time()}\n") |