[v3,3/5] configurehood: Only provide hood file from GW/KeyXchange via WWW

Submitted by Adrian Schmutzler on July 8, 2018, 5:57 p.m.

Details

Message ID 1531072659-4217-3-git-send-email-freifunk@adrianschmutzler.de
State Accepted
Headers show

Commit Message

Adrian Schmutzler July 8, 2018, 5:57 p.m.
This will copy to hoodfilewww every 5 minutes!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

Changes in v2:
- Remove additional auth file
- Copy directly after hood file retrieval

Changes in v3:
Rebase
---
 src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
index b6ba3e3..de722f0 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -74,7 +74,7 @@  if [ -s "$hoodfilelocal" ]; then
 else
 	# if we have Internet, we download the Hoodfile from the keyxchangev2
 	if hasInternet ; then
-		getKeyserverHoodfile "$hoodfiletmp"
+		getKeyserverHoodfile "$hoodfiletmp" && cp "$hoodfiletmp" "$hoodfilewww"
 
 		#if no Internet, we connect to the hidden AP and download the file from another Node in range
 	else
@@ -95,7 +95,7 @@  else
 			getEthernetHoodfile "$hoodfiletmp" || getWirelessHoodfile "$hoodfiletmp"
 		else
 			echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
-			getGatewayHoodfile "$hoodfiletmp"
+			getGatewayHoodfile "$hoodfiletmp" && cp "$hoodfiletmp" "$hoodfilewww"
 		fi
 	fi
 fi
@@ -187,7 +187,6 @@  if [ -s "$hoodfiletmp" ]; then
 		# copy the file to webroot so that other mesh routers can download it;
 		# copy only after all other steps so IF can be reentered if something goes wrong
 		cp "$hoodfiletmp" "$hoodfileref"
-		cp "$hoodfiletmp" "$hoodfilewww"
 
 		# This is a workaround to enable alfred on devices which do not see a configap during initial setup
 		/etc/init.d/alfred restart

Comments

Fabian Blaese July 8, 2018, 7:22 p.m.
Die v2 von diesem Patch(set) hatte ich total übersehen.
Sollte seit der v2 keine Randfälle mehr haben..

Reviewed-by: Fabian Bläse <fabian@blaese.de>

> On 8. Jul 2018, at 19:57, Adrian Schmutzler <freifunk@adrianschmutzler.de> wrote:
> 
> This will copy to hoodfilewww every 5 minutes!
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> 
> ---
> 
> Changes in v2:
> - Remove additional auth file
> - Copy directly after hood file retrieval
> 
> Changes in v3:
> Rebase
> ---
> src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index b6ba3e3..de722f0 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -74,7 +74,7 @@ if [ -s "$hoodfilelocal" ]; then
> else
> 	# if we have Internet, we download the Hoodfile from the keyxchangev2
> 	if hasInternet ; then
> -		getKeyserverHoodfile "$hoodfiletmp"
> +		getKeyserverHoodfile "$hoodfiletmp" && cp "$hoodfiletmp" "$hoodfilewww"
> 
> 		#if no Internet, we connect to the hidden AP and download the file from another Node in range
> 	else
> @@ -95,7 +95,7 @@ else
> 			getEthernetHoodfile "$hoodfiletmp" || getWirelessHoodfile "$hoodfiletmp"
> 		else
> 			echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
> -			getGatewayHoodfile "$hoodfiletmp"
> +			getGatewayHoodfile "$hoodfiletmp" && cp "$hoodfiletmp" "$hoodfilewww"
> 		fi
> 	fi
> fi
> @@ -187,7 +187,6 @@ if [ -s "$hoodfiletmp" ]; then
> 		# copy the file to webroot so that other mesh routers can download it;
> 		# copy only after all other steps so IF can be reentered if something goes wrong
> 		cp "$hoodfiletmp" "$hoodfileref"
> -		cp "$hoodfiletmp" "$hoodfilewww"
> 
> 		# This is a workaround to enable alfred on devices which do not see a configap during initial setup
> 		/etc/init.d/alfred restart
> --
> 2.7.4
>
Robert Langhammer July 9, 2018, 12:25 p.m.
Sieht auch gut aus

Reviewed-by: Robert Langhammer <rlanghammer@web.de>


Am 08.07.2018 um 19:57 schrieb Adrian Schmutzler:
> This will copy to hoodfilewww every 5 minutes!
>
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
>
> ---
>
> Changes in v2:
> - Remove additional auth file
> - Copy directly after hood file retrieval
>
> Changes in v3:
> Rebase
> ---
>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index b6ba3e3..de722f0 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -74,7 +74,7 @@ if [ -s "$hoodfilelocal" ]; then
>  else
>  	# if we have Internet, we download the Hoodfile from the keyxchangev2
>  	if hasInternet ; then
> -		getKeyserverHoodfile "$hoodfiletmp"
> +		getKeyserverHoodfile "$hoodfiletmp" && cp "$hoodfiletmp" "$hoodfilewww"
>  
>  		#if no Internet, we connect to the hidden AP and download the file from another Node in range
>  	else
> @@ -95,7 +95,7 @@ else
>  			getEthernetHoodfile "$hoodfiletmp" || getWirelessHoodfile "$hoodfiletmp"
>  		else
>  			echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
> -			getGatewayHoodfile "$hoodfiletmp"
> +			getGatewayHoodfile "$hoodfiletmp" && cp "$hoodfiletmp" "$hoodfilewww"
>  		fi
>  	fi
>  fi
> @@ -187,7 +187,6 @@ if [ -s "$hoodfiletmp" ]; then
>  		# copy the file to webroot so that other mesh routers can download it;
>  		# copy only after all other steps so IF can be reentered if something goes wrong
>  		cp "$hoodfiletmp" "$hoodfileref"
> -		cp "$hoodfiletmp" "$hoodfilewww"
>  
>  		# This is a workaround to enable alfred on devices which do not see a configap during initial setup
>  		/etc/init.d/alfred restart
Tim Niemeyer July 25, 2018, 8:54 p.m.
Hi

Das hier ist der eigentliche Trick von dem ganzen Patchset.

Reviewed-by: Tim Niemeyer <tim@tn-x.org>

Tim

Am Sonntag, den 08.07.2018, 19:57 +0200 schrieb Adrian Schmutzler:
> This will copy to hoodfilewww every 5 minutes!
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> 
> ---
> 
> Changes in v2:
> - Remove additional auth file
> - Copy directly after hood file retrieval
> 
> Changes in v3:
> Rebase
> ---
>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index b6ba3e3..de722f0 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -74,7 +74,7 @@ if [ -s "$hoodfilelocal" ]; then
>  else
>  	# if we have Internet, we download the Hoodfile from the
> keyxchangev2
>  	if hasInternet ; then
> -		getKeyserverHoodfile "$hoodfiletmp"
> +		getKeyserverHoodfile "$hoodfiletmp" && cp
> "$hoodfiletmp" "$hoodfilewww"
>  
>  		#if no Internet, we connect to the hidden AP and
> download the file from another Node in range
>  	else
> @@ -95,7 +95,7 @@ else
>  			getEthernetHoodfile "$hoodfiletmp" ||
> getWirelessHoodfile "$hoodfiletmp"
>  		else
>  			echo "We have a Gateway in Range, we load
> the keyxchangev2data from fe80::1"
> -			getGatewayHoodfile "$hoodfiletmp"
> +			getGatewayHoodfile "$hoodfiletmp" && cp
> "$hoodfiletmp" "$hoodfilewww"
>  		fi
>  	fi
>  fi
> @@ -187,7 +187,6 @@ if [ -s "$hoodfiletmp" ]; then
>  		# copy the file to webroot so that other mesh
> routers can download it;
>  		# copy only after all other steps so IF can be
> reentered if something goes wrong
>  		cp "$hoodfiletmp" "$hoodfileref"
> -		cp "$hoodfiletmp" "$hoodfilewww"
>  
>  		# This is a workaround to enable alfred on devices
> which do not see a configap during initial setup
>  		/etc/init.d/alfred restart