fff-hoods: Suppress warning for missing sectorfile

Submitted by Adrian Schmutzler on Nov. 4, 2017, 2:06 p.m.

Details

Message ID 1509804363-2104-1-git-send-email-freifunk@adrianschmutzler.de
State Accepted
Headers show

Commit Message

Adrian Schmutzler Nov. 4, 2017, 2:06 p.m.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 5447d2f..000e3b8 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -232,7 +232,7 @@  if [ -s "$hoodfile" ]; 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 "$hoodfile" "$hoodfilecopy"
-		cp "$sectortmp" "$sectorcopy"
+		[ -s "$sectortmp" ] && cp "$sectortmp" "$sectorcopy"
 
 	else
 		echo "We have no new file. We do nothing. We try it again in 5 minutes...";

Comments

Tim Niemeyer Nov. 4, 2017, 2:33 p.m.
Hi

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

Tim

Am Samstag, den 04.11.2017, 15:06 +0100 schrieb Adrian Schmutzler:
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>  src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> index 5447d2f..000e3b8 100755
> --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> @@ -232,7 +232,7 @@ if [ -s "$hoodfile" ]; 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 "$hoodfile" "$hoodfilecopy"
> -		cp "$sectortmp" "$sectorcopy"
> +		[ -s "$sectortmp" ] && cp "$sectortmp" "$sectorcopy"
>  
>  	else
>  		echo "We have no new file. We do nothing. We try it
> again in 5 minutes...";
> -- 
> 2.7.4
>
Tim Niemeyer Nov. 4, 2017, 2:52 p.m.
Hi

Und applied.

Tim

Am Samstag, den 04.11.2017, 15:33 +0100 schrieb Tim Niemeyer:
> Hi
> 
> Reviewed-by: Tim Niemeyer <tim@tn-x.org>
> 
> Tim
> 
> Am Samstag, den 04.11.2017, 15:06 +0100 schrieb Adrian Schmutzler:
> > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> > ---
> >  src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/packages/fff/fff-
> > hoods/files/usr/sbin/configurehood
> > b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> > index 5447d2f..000e3b8 100755
> > --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> > +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
> > @@ -232,7 +232,7 @@ if [ -s "$hoodfile" ]; 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 "$hoodfile" "$hoodfilecopy"
> > -		cp "$sectortmp" "$sectorcopy"
> > +		[ -s "$sectortmp" ] && cp "$sectortmp"
> > "$sectorcopy"
> >  
> >  	else
> >  		echo "We have no new file. We do nothing. We try
> > it
> > again in 5 minutes...";
> > -- 
> > 2.7.4