forked from freifunk-franken/firmware
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:
parent
4a23b1baf7
commit
9e0952e01e
|
@ -11,6 +11,7 @@ sectortmp=/tmp/sectorfile
|
|||
sectorcopy=/www/hood/sectorfile
|
||||
hiddenapfile=/tmp/hiddenapflag
|
||||
resetnetworkfile=/tmp/resetnetwork
|
||||
hoodlocal=/etc/hoodfile
|
||||
|
||||
rm -f "$hoodfile"
|
||||
|
||||
|
@ -72,14 +73,18 @@ if [ -f "$resetnetworkfile" ]; then
|
|||
rm "$resetnetworkfile"
|
||||
fi
|
||||
|
||||
# if we have Internet, we download the Hoodfile from the keyxchangev2
|
||||
if hasInternet ; then
|
||||
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"
|
||||
rm -f "$sectortmp"
|
||||
[ -s "$sectorlocal" ] || rm -f "$sectorcopy" # If internet present, no custom config should be distributed, except when local file is present
|
||||
#UPLINK: No uplink download if internet present
|
||||
#if no Internet, we connect to the hidden AP and download the file from another Node in range
|
||||
else
|
||||
else
|
||||
# connect to wireless hidden ap here and download the json File from the nearest router
|
||||
# Only do that, when we have no gateway in range. If the Uplinkrouter changed the hood, we lost the GW and do this automatically again, I think! Nice idea?
|
||||
if ! isGatewayAvailable ; then
|
||||
|
@ -159,6 +164,7 @@ else
|
|||
fi
|
||||
#UPLINK: Do nothing
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -s "$hoodfile" ]; then
|
||||
|
|
|
@ -9,4 +9,5 @@ cat > /etc/sysupgrade.conf <<-__EOF__
|
|||
/etc/dropbear/authorized_keys
|
||||
/etc/network.config
|
||||
/etc/config/fff
|
||||
/etc/hoodfile
|
||||
__EOF__
|
||||
|
|
Loading…
Reference in New Issue