33 lines
628 B
Bash
Executable File
33 lines
628 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
|
|
|
|
debmirror \
|
|
-a ${UBUNTU_MIRROR_ARCHITECTURES} \
|
|
-s ${UBUNTU_MIRROR_CATEGORIES} \
|
|
-h ${UBUNTU_MIRROR_UPSTREAM} \
|
|
-d ${UBUNTU_MIRROR_PROJECTS} \
|
|
$SOURCEOPT \
|
|
--ignore-small-errors \
|
|
-r /ubuntu \
|
|
--getcontents \
|
|
--progress \
|
|
--method=http \
|
|
$DST/ubuntu
|
|
|
|
chmod -R a+rX $DST
|