From 1ceb38ac26e9203bfb4770f864ede702529ca9d4 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 21 Jan 2014 03:05:42 +0100
Subject: [PATCH] gluon-mesh-batman-adv: more initial -> invariant conversions

---
 .../upgrade/mesh-batman-adv/initial/010-mesh  | 25 --------------
 .../mesh-batman-adv/invariant/011-mesh        | 33 +++++++++++++++++++
 2 files changed, 33 insertions(+), 25 deletions(-)
 create mode 100755 package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/invariant/011-mesh

diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/initial/010-mesh b/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/initial/010-mesh
index 5632f6daf..6fca75331 100755
--- a/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/initial/010-mesh
+++ b/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/initial/010-mesh
@@ -4,12 +4,6 @@
 . /lib/gluon/functions/sysconfig.sh
 
 
-uci_remove batman-adv bat0
-uci_add batman-adv mesh bat0
-uci_set batman-adv bat0 orig_interval '5000'
-uci_set batman-adv bat0 gw_mode 'client'
-uci_commit batman-adv
-
 uci_add network interface client
 uci_set network client ifname "$(sysconfig lan_ifname) bat0"
 uci_set network client type 'bridge'
@@ -18,23 +12,4 @@ uci_set network client reqprefix 'no'
 uci_set network client peerdns '0'
 uci_set network client macaddr "$(sysconfig primary_mac)"
 
-uci_add network interface bat0
-uci_set network bat0 ifname 'bat0'
-uci_set network bat0 proto 'none'
-uci_set network bat0 macaddr "$(sysconfig primary_mac)"
-uci_commit network
-
-uci_add firewall zone client
-uci_set firewall client name 'client'
-uci add_list firewall.client.network='client'
-uci_set firewall client input 'ACCEPT'
-uci_set firewall client output 'ACCEPT'
-uci_set firewall client forward 'REJECT'
-uci_commit firewall
-
-uci_add dhcp dhcp client
-uci_set dhcp client interface 'client'
-uci_set dhcp client ignore '1'
-uci_commit dhcp
-
 echo 'net.ipv6.conf.br-client.forwarding=0' >> /etc/sysctl.conf
diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/invariant/011-mesh b/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/invariant/011-mesh
new file mode 100755
index 000000000..6398d2c33
--- /dev/null
+++ b/package/gluon-mesh-batman-adv/files/lib/gluon/upgrade/mesh-batman-adv/invariant/011-mesh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/gluon/functions/sysconfig.sh
+
+
+uci_remove batman-adv bat0
+uci_add batman-adv mesh bat0
+uci_set batman-adv bat0 orig_interval '5000'
+uci_set batman-adv bat0 gw_mode 'client'
+uci_commit batman-adv
+
+uci_remove network bat0
+uci_add network interface bat0
+uci_set network bat0 ifname 'bat0'
+uci_set network bat0 proto 'none'
+uci_set network bat0 macaddr "$(sysconfig primary_mac)"
+uci_commit network
+
+uci_remove firewall client
+uci_add firewall zone client
+uci_set firewall client name 'client'
+uci add_list firewall.client.network='client'
+uci_set firewall client input 'ACCEPT'
+uci_set firewall client output 'ACCEPT'
+uci_set firewall client forward 'REJECT'
+uci_commit firewall
+
+uci_remove dhcp client
+uci_add dhcp dhcp client
+uci_set dhcp client interface 'client'
+uci_set dhcp client ignore '1'
+uci_commit dhcp
-- 
GitLab