summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/freifunk-common/files/etc/rc.local.d
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2011-09-28 00:20:56 +0000
committerManuel Munz <freifunk@somakoma.de>2011-09-28 00:20:56 +0000
commitc3a028c76c294c0578b0449d75f9aeaad209c8d1 (patch)
treeda549085750d64091f3bc43992cf1c8417edd20c /contrib/package/freifunk-common/files/etc/rc.local.d
parent876b191b20a01926657e4d3c618fd2f029f45f4d (diff)
modules/freifunk: Move profiles and common files into seperate packages, this will enable us to build freifunk images without luci.
Diffstat (limited to 'contrib/package/freifunk-common/files/etc/rc.local.d')
-rw-r--r--contrib/package/freifunk-common/files/etc/rc.local.d/01-config-migration51
1 files changed, 51 insertions, 0 deletions
diff --git a/contrib/package/freifunk-common/files/etc/rc.local.d/01-config-migration b/contrib/package/freifunk-common/files/etc/rc.local.d/01-config-migration
new file mode 100644
index 0000000000..11f1ad60bc
--- /dev/null
+++ b/contrib/package/freifunk-common/files/etc/rc.local.d/01-config-migration
@@ -0,0 +1,51 @@
+# Fixup various configurations to remove quirks
+# from former versions.
+
+_log() {
+ logger -t "Config Migration" "$1"
+}
+
+_uci() {
+ uci ${2:+-c $2} get "$1" 2>/dev/null
+}
+
+
+# Splash redirector had a wrong virtual url match
+# which resulted in "No such handler"
+
+[ "$(_uci lucid.splashredir.virtual)" == "/" ] && {
+ _log "Fix splash redirector configuration"
+ uci set lucid.splashredir.virtual=''
+ uci commit lucid
+ /etc/init.d/lucid restart
+}
+
+
+# Newer OLSR versions have the MinTCVtime hack active,
+# ensure proper timings or olsrd won't start
+
+FIX=0
+for i in 0 1 2 3 4; do
+ [ -z "$(_uci olsrd.@Interface[$i].TcInterval)" ] && \
+ [ -z "$(_uci olsrd.@Interface[$i].TcValidityTime)" ] || {
+ uci delete olsrd.@Interface[$i].TcInterval
+ uci delete olsrd.@Interface[$i].TcValidityTime
+ FIX=1
+ }
+done
+
+[ "$FIX" == 1 ] && {
+ _log "Fix olsrd configuration for MinTCVTime hack"
+ uci commit olsrd
+ /etc/init.d/olsrd restart
+}
+
+
+# Ensure that the community definitions are in the
+# new format
+
+[ -z "$(_uci freifunk.leipzig.mesh_network)" ] && \
+[ -n "$(_uci freifunk.leipzig.mesh_network /rom/etc/config)" ] && {
+ _log "Converting freifunk configuration to new format"
+ cp /rom/etc/config/freifunk /etc/config/freifunk
+}