Skip to content
Snippets Groups Projects
Commit bce43a3a authored by Fabian Blaese's avatar Fabian Blaese Committed by Tim Niemeyer
Browse files

Allow initial configuration from Ethernet


Signed-off-by: default avatarFabian Bläse <fabian@blaese.de>
Tested-by: default avatarFabian Bläse <fabian@blaese.de>
Reviewed-by: default avatarAdrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: default avatarTim Niemeyer <tim@tn-x.org>
Reviewed-by: default avatarRobert Langhgammer <rlanghammer@web.de>
parent bb496df2
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,30 @@ getWirelessHoodfile() { ...@@ -53,6 +53,30 @@ getWirelessHoodfile() {
fi fi
} }
getEthernetHoodfile() {
if [ $# != 1 ]; then
echo "Usage: getEthernetHoodfile <target-file>"
return 1
fi
file=$1
echo "Trying to get hoodfile from ethernet neighbor..."
if ! ethmesh_dev=$(uci -q get network.ethmesh.ifname); then
# no ethmesh interface
return 1
fi
neighbor_addrs=$(ping6 -c2 ff02::1%"${ethmesh_dev}" | grep seq | grep DUP | cut -d " " -f4 | sed s/:$//g | sort -u)
for addr in $neighbor_addrs; do
wget -T2 -t1 -qO "$file" "http://[${addr}%${ethmesh_dev}]:2342/keyxchangev2data" && return 0
done
# got no hoodfile
return 1
}
getGatewayHoodfile() { getGatewayHoodfile() {
if [ $# != 1 ]; then if [ $# != 1 ]; then
echo "Usage: getGatewayHoodfile <target-file>" echo "Usage: getGatewayHoodfile <target-file>"
......
...@@ -98,7 +98,7 @@ else ...@@ -98,7 +98,7 @@ else
sleep 30 # Wait for the config AP, which may be created at the same time as this script has started sleep 30 # Wait for the config AP, which may be created at the same time as this script has started
getWirelessHoodfile "$hoodfile" getEthernetHoodfile "$hoodfile" || getWirelessHoodfile "$hoodfile"
#UPLINK: Set up uplink data on first contact: #UPLINK: Set up uplink data on first contact:
if [ -s /tmp/keyxchangev2data ]; then if [ -s /tmp/keyxchangev2data ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment