Fwd: [PATCH v3 2/2] Allow initial configuration from Ethernet
mayosemmel at googlemail.com
mayosemmel at googlemail.com
Mo Jun 11 20:23:38 CEST 2018
Der sieht für mich zwar schlüssig aus, bin mir aber nicht ganz sicher,
da ich den Rest zu schlecht verfolgt hab.
Grüße Jan
Am Montag, den 11.06.2018, 20:02 +0200 schrieb Christian Dresel:
>
>
>
> -------- Forwarded Message --------
> Subject: [PATCH v3 2/2] Allow initial configuration from
> Ethernet
> Date: Mon, 11 Jun 2018 19:52:05 +0200
> From: Fabian Bläse <fabian at blaese.de>
> To: franken-dev at franken.net
> CC: Adrian Schmutzler <freifunk at adrianschmutzler.de>, Robert
> Langhgammer <rlanghammer at web.de>, Christian Dresel <fff at chrisi01.de>,
> Fabian Bläse <fabian at blaese.de>
>
> Signed-off-by: Fabian Bläse <fabian at blaese.de>
> ---
> Apply after MacKnocker patchset!
>
> Changes in v2:
> - Fix indentation
> - Improve usage message
> - Return if no ethmesh_dev exists
> - Replace . with : in ping6 sed
>
> Changes in v3:
> - Fix messed up v2
> ---
> .../fff-hoods/files/usr/lib/functions/fff/hoodfile | 24
> ++++++++++++++++++++++
> .../fff/fff-hoods/files/usr/sbin/configurehood | 2 +-
> 2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/src/packages/fff/fff-
> hoods/files/usr/lib/functions/fff/hoodfile b/src/packages/fff/fff-
> hoods/files/usr/lib/functions/fff/hoodfile
> index 306535e..bc52883 100644
> --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
> +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
> @@ -53,6 +53,30 @@ getWirelessHoodfile() {
> 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
> | cut -d " " -f4 | sed s/:$//g | sort | uniq)
> +
> + 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() {
> if [ $# != 1 ]; then
> echo "Usage: getGatewayHoodfile <target-file>"
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index aee20e5..282e21b 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -101,7 +101,7 @@ else
>
> 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:
> if [ -s /tmp/keyxchangev2data ]; then
Mehr Informationen über die Mailingliste franken-dev