docker-ubuntumirror/mirror/syncubuntu.sh

33 lines
595 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 [[ ! -z "$UBUNTU_SOURCE_MIRROR" ]]; then
SOURCEOPT="--source"
fi
debmirror \
-a ${MIRROR_ARCHITECTURES} \
$SOURCEOPT \
-s ${MIRROR_CATEGORIES} \
-h ${UBUNTU_MIRROR_SOURCE} \
-d ${UBUNTU_MIRROR_PROJECTS} \
--ignore-small-errors \
-r /ubuntu \
--getcontents \
--progress \
--method=http \
$DST/ubuntu
chmod -R a+rX $DST