configurehood: Don't remove timestamp for checksum comparison

Timestamps in hood file currently only change if changes are
made. Thus, there is no reason to remove them for comparison.

This also fixes the wrong quote characters in the script, which
changed the script in a way the timestamps aren't removed right
now anyway.

After this change, a hood reconfiguration may be triggered by
just changing the timestamp at the keyxchange.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
This commit is contained in:
Adrian Schmutzler 2018-07-08 19:57:39 +02:00 committed by Tim Niemeyer
parent 4a266c8301
commit f986d59080
1 changed files with 2 additions and 4 deletions

View File

@ -106,10 +106,8 @@ if [ -s "$hoodfiletmp" ]; then
# https://pw.freifunk-franken.de/patch/205/
# but without signature, every hood file we get is valid!
catnew="$(cat "$hoodfiletmp" | sed 's/"timestamp”: *"[0-9]*"/"timestamp":0/')"
catold="$(cat "$hoodfileref" 2>/dev/null | sed 's/"timestamp”: *"[0-9]*"/"timestamp":0/')"
sumnew=$(echo "$catnew" | sha256sum | cut -f1 -d " ")
sumold=$(echo "$catold" | sha256sum | cut -f1 -d " ")
sumnew=$(cat "$hoodfiletmp" 2>/dev/null | sha256sum | cut -f1 -d " ")
sumold=$(cat "$hoodfileref" 2>/dev/null | sha256sum | cut -f1 -d " ")
json_load "$(cat "$hoodfiletmp")"