tici: only write eSIM connection once

pull/34264/head
Adeeb Shihadeh 4 months ago
parent 5018cf75ff
commit b2930682ff
  1. 4
      system/hardware/tici/hardware.py

@ -505,8 +505,8 @@ class Tici(HardwareBase):
pass pass
# eSIM prime # eSIM prime
if sim_id.startswith('8985235'): dest = "/etc/NetworkManager/system-connections/esim.nmconnection"
dest = "/etc/NetworkManager/system-connections/esim.nmconnection" if sim_id.startswith('8985235') and not os.path.exists(dest):
with open(Path(__file__).parent/'esim.nmconnection') as f, tempfile.NamedTemporaryFile(mode='w') as tf: with open(Path(__file__).parent/'esim.nmconnection') as f, tempfile.NamedTemporaryFile(mode='w') as tf:
dat = f.read() dat = f.read()
dat = dat.replace("sim-id=", f"sim-id={sim_id}") dat = dat.replace("sim-id=", f"sim-id={sim_id}")

Loading…
Cancel
Save