mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 12:42:50 +00:00
added timeout to apt-download
This commit is contained in:
parent
f6d9201e7d
commit
dda03ab110
@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
_here=`dirname $(realpath $0)`
|
_here=`dirname $(realpath $0)`
|
||||||
. ${_here}/helpers/apt-download
|
. ${_here}/helpers/apt-download
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
set -o pipefail
|
||||||
LOADED_APT_DOWNLOAD="yes"
|
LOADED_APT_DOWNLOAD="yes"
|
||||||
|
|
||||||
function check-and-download() {
|
function check-and-download() {
|
||||||
remote_file=$1
|
remote_file=$1
|
||||||
local_file=$2
|
local_file=$2
|
||||||
wget -q --spider ${remote_file}
|
timeout -s INT 60 wget -q --spider ${remote_file}
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "downloading ${remote_file}"
|
echo "downloading ${remote_file}"
|
||||||
wget -q -N -O ${local_file} ${remote_file}
|
timeout -s INT 300 wget -q -N -O ${local_file} ${remote_file}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
@ -25,6 +26,7 @@ function apt-download-binary() {
|
|||||||
echo "Destination directory is empty, cannot continue"
|
echo "Destination directory is empty, cannot continue"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
echo "Started mirroring ${base_url} ${dist}, ${repo}, ${arch}!"
|
||||||
|
|
||||||
dest_dir="${dest_base_dir}/dists/${dist}"
|
dest_dir="${dest_base_dir}/dists/${dist}"
|
||||||
[ ! -d "$dest_dir" ] && mkdir -p "$dest_dir"
|
[ ! -d "$dest_dir" ] && mkdir -p "$dest_dir"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user