On Wed, Jan 10, 2018 at 2:45 PM, geraldo netto <geraldone...@gmail.com>
wrote:

> Signed-off-by: geraldo netto <geraldone...@gmail.com>
> ---
>  tomcat/GET | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tomcat/GET b/tomcat/GET
> index b96d963..35351d8 100755
> --- a/tomcat/GET
> +++ b/tomcat/GET
> @@ -8,7 +8,12 @@ archive=$dir.tar.gz
>
>  mkdir -p upstream
>  pushd upstream
> -wget http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v$
> {VERSION}/bin/${archive}
> +
> +if [ ! -f $archive ];
> +then
> +    wget http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v$
> {VERSION}/bin/${archive}
> +fi
> +
>

You can also use "wget -nc" to do the same with fewer lines of code.

But what bothers me is that this only tests if the file exists. If someone
or something previously interrupted a download in the middle, the file will
exist, but will be incomplete.
How about using "wget -c" to resume the download, or do nothing if it
already finished (although this "nothing" will involve a connection to the
server, so will take a bit of time)?


>  tar zxvf $archive
>
>  pushd $dir
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to