docker-ubuntumirror/mirror/syncubuntu.sh
sneak d90e22b44f
All checks were successful
continuous-integration/drone/push Build is passing
update readme, fix some bugs
2020-02-15 10:29:22 -08:00

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