fff-hoods: Make possible to use fixed hoodfile

Add a complete hoodfile to /etc/hoodfile to use only this file

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
- Changed according to Adrian's review
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
This commit is contained in:
Christian Dresel 2018-01-02 15:46:37 +01:00 committed by Tim Niemeyer
parent 4a23b1baf7
commit 9e0952e01e
2 changed files with 87 additions and 80 deletions

View File

@ -11,6 +11,7 @@ sectortmp=/tmp/sectorfile
sectorcopy=/www/hood/sectorfile
hiddenapfile=/tmp/hiddenapflag
resetnetworkfile=/tmp/resetnetwork
hoodlocal=/etc/hoodfile
rm -f "$hoodfile"
@ -72,6 +73,10 @@ if [ -f "$resetnetworkfile" ]; then
rm "$resetnetworkfile"
fi
if [ -s "$hoodlocal" ]; then
hoodfile="$hoodlocal"
echo "Use local hood file"
else
# if we have Internet, we download the Hoodfile from the keyxchangev2
if hasInternet ; then
wget -T15 -t5 "http://keyserver.freifunk-franken.de/v2/?lat=$lat&long=$long" -O "$hoodfile"
@ -160,6 +165,7 @@ else
#UPLINK: Do nothing
fi
fi
fi
if [ -s "$hoodfile" ]; then

View File

@ -9,4 +9,5 @@ cat > /etc/sysupgrade.conf <<-__EOF__
/etc/dropbear/authorized_keys
/etc/network.config
/etc/config/fff
/etc/hoodfile
__EOF__