From 52933c99525f1cd5af055d070de079b7176b548a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80?=
<78488229+viktor138irk@users.noreply.github.com>
Date: Thu, 7 May 2026 10:48:14 +0900
Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B0=D1=82=D1=87=20=D0=BF=D0=BE=D0=BB?=
=?UTF-8?q?=D1=8F=20=D1=80=D1=83=D1=87=D0=BD=D0=BE=D0=B3=D0=BE=20IP=20?=
=?UTF-8?q?=D0=B1=D1=8B=D0=BB=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?=
=?UTF-8?q?=D0=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
scripts/patch_network_manual_ip_field.py | 25 ++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 scripts/patch_network_manual_ip_field.py
diff --git a/scripts/patch_network_manual_ip_field.py b/scripts/patch_network_manual_ip_field.py
new file mode 100644
index 0000000..1ba459d
--- /dev/null
+++ b/scripts/patch_network_manual_ip_field.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+from pathlib import Path
+import sys
+
+app_path = Path(sys.argv[1]) if len(sys.argv) > 1 else Path('/opt/virtuality/web/app.py')
+template_path = app_path.with_name('templates') / 'network.html'
+if not template_path.exists():
+ raise SystemExit(f'network.html not found: {template_path}')
+
+text = template_path.read_text()
+old = ''
+new = ''''''
+
+if old in text:
+ text = text.replace(old, new, 1)
+ template_path.write_text(text)
+ print('network manual IP field added')
+elif 'name="guest_ip" value="auto" placeholder="auto' in text:
+ print('network manual IP field already present')
+else:
+ raise SystemExit('guest_ip marker not found in network.html')