42 lines
862 B
Bash
Executable File
42 lines
862 B
Bash
Executable File
#!/bin/bash
|
|
set -x
|
|
|
|
THISDIR="$(cd $(dirname "$BASH_SOURCE") && pwd -P)"
|
|
DST="/var/mirror"
|
|
|
|
echo "$THIS_MIRROR_URL" > $DST/mirrors.txt
|
|
chmod a+r $DST/mirrors.txt
|
|
|
|
mkdir -p "$DST/ubuntu"
|
|
|
|
export GNUPGHOME="/etc/debmirror/ubuntu"
|
|
|
|
SOURCEOPT="--nosource"
|
|
if [[ "$UBUNTU_ENABLE_SOURCE_MIRRORING" != "false" ]]; then
|
|
SOURCEOPT="--source"
|
|
fi
|
|
|
|
DONE=0
|
|
|
|
while [[ $DONE -eq 0 ]]; do
|
|
debmirror \
|
|
-a ${UBUNTU_MIRROR_ARCHITECTURES} \
|
|
-s ${UBUNTU_MIRROR_CATEGORIES} \
|
|
-h ${UBUNTU_MIRROR_UPSTREAM} \
|
|
-d ${UBUNTU_MIRROR_PROJECTS} \
|
|
$SOURCEOPT \
|
|
--di-dist=dists \
|
|
--di-arch=arches \
|
|
--ignore-small-errors \
|
|
-r /ubuntu \
|
|
--getcontents \
|
|
--progress \
|
|
--method=http \
|
|
$DST/ubuntu
|
|
if [[ $? -eq 0 ]]; then
|
|
DONE=1
|
|
fi
|
|
chmod -R a+rX $DST
|
|
sleep 1
|
|
done
|