From b8c3aa96d40747feb41ceb72e747a3ee0fa84bf9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 16 Jun 2009 13:27:36 +0000 Subject: [PATCH 1/1] modules/freifunk: add a rc.local.d hook to fix config quirks after migration --- .../root/etc/rc.local.d/01-config-migration | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 modules/freifunk/root/etc/rc.local.d/01-config-migration diff --git a/modules/freifunk/root/etc/rc.local.d/01-config-migration b/modules/freifunk/root/etc/rc.local.d/01-config-migration new file mode 100644 index 000000000..1ab7239c8 --- /dev/null +++ b/modules/freifunk/root/etc/rc.local.d/01-config-migration @@ -0,0 +1,41 @@ +# Fixup various configurations to remove quirks +# from former versions. + +_log() { + logger -t "Config Migration" "$1" +} + +_uci() { + uci 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 +} -- 2.11.0