From b7ad04f321487806f9038a1318676b4e9052915f Mon Sep 17 00:00:00 2001
From: Jan Grewe <jan@faked.org>
Date: Mon, 27 May 2024 19:25:40 +0200
Subject: [PATCH] fix network

---
 files/etc/config/openwisp        |  2 ++
 files/etc/uci-defaults/99-custom |  7 -------
 files/etc/uci-defaults/99_custom | 15 +++++++++++++++
 3 files changed, 17 insertions(+), 7 deletions(-)
 delete mode 100644 files/etc/uci-defaults/99-custom
 create mode 100644 files/etc/uci-defaults/99_custom

diff --git a/files/etc/config/openwisp b/files/etc/config/openwisp
index ceefe2c..7cdd022 100644
--- a/files/etc/config/openwisp
+++ b/files/etc/config/openwisp
@@ -1,3 +1,5 @@
 config controller 'http'
         option url 'https://openwisp.faked.org'
         option shared_secret 'fSIRdSdsqoKYhCYovE1zareJhkOKMtcL'
+        mac_interface 'br-lan'
+        management_interface 'br-lan'
diff --git a/files/etc/uci-defaults/99-custom b/files/etc/uci-defaults/99-custom
deleted file mode 100644
index ded919a..0000000
--- a/files/etc/uci-defaults/99-custom
+++ /dev/null
@@ -1,7 +0,0 @@
-cat << "EOF" > /etc/uci-defaults/99-custom
-uci -q batch << EOI
-set network.lan.proto='dhcp'
-delete network.lan.ipaddr
-delete network.lan.netmask
-EOI
-EOF
diff --git a/files/etc/uci-defaults/99_custom b/files/etc/uci-defaults/99_custom
new file mode 100644
index 0000000..fafe4a8
--- /dev/null
+++ b/files/etc/uci-defaults/99_custom
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+uci set system.@system[0].hostname='openwrt'
+uci commit system
+
+uci batch <<-EOF >/dev/null
+  set network.lan.proto=dhcp
+  delete network.lan.ipaddr
+  delete network.lan.netmask
+  commit network
+EOF
+
+/etc/init.d/network restart
+
+exit 0
-- 
GitLab