[PATCH 2/2] Allow initial configuration from Ethernet
Tim Niemeyer
tim at tn-x.org
So Jun 10 11:38:49 CEST 2018
Am Sonntag, den 10.06.2018, 01:15 +0200 schrieb robert:
> Hallo Fabian,
> ja, die Patches lösen #95.
Puh. Jetzt ist es alles so lange. Das ist schwierig alles zusammen zu
kriegen.
Meinst du jetzt die beiden Patches von Fabian + meine 4-MacNocker
Patches zusammen?
> Habs jetzt auch gesehen. Mir hat der 832er gefehlt.
https://pw.freifunk-franken.de/patch/832/
> Gut ist auch, dass configurehood etwas schlanker wird.
Oh ja. :)
Tim
> Kleine Anmerkung: kein shebang in files die nur gesourced werden.
> Reviewed-by: Robert Langhgammer <rlanghammer at web.de>
>
> Am 09.06.2018 um 16:51 schrieb Fabian Bläse:
> > Signed-off-by: Fabian Bläse <fabian at blaese.de>
> > ---
> > .../fff-hoods/files/usr/lib/functions/fff/hoodfile | 21
> > +++++++++++++++++++++
> > .../fff/fff-hoods/files/usr/sbin/configurehood | 2 +-
> > 2 files changed, 22 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 62487f9..6c50737 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
> > @@ -56,6 +56,27 @@ getWirelessHoodfile() {
> > fi
> > }
> >
> > +getEthernetHoodfile() {
> > + if [ $# != 1 ]
> > + then
> > + echo "Usage: getEthernetHoodfile <download-
> > location>"
> > + return 1
> > + fi
> > + file=$1
> > +
> > + echo "Trying to get hoodfile from ethernet neighbor..."
> > +
> > + ethmesh_dev=$(uci -q get network.ethmesh.ifname)
> > + 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
> > 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
>
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : signature.asc
Dateityp : application/pgp-signature
Dateigröße : 488 bytes
Beschreibung: This is a digitally signed message part
URL : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20180610/87243541/attachment.sig>
Mehr Informationen über die Mailingliste franken-dev