2016-04-08 20:41:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -x
|
|
|
|
|
|
|
|
THISDIR="$(cd $(dirname "$BASH_SOURCE") && pwd -P)"
|
|
|
|
DST="/var/mirror"
|
|
|
|
|
2020-02-15 17:55:25 +00:00
|
|
|
echo "$THIS_MIRROR_URL" > $DST/mirrors.txt
|
2016-04-11 02:36:47 +00:00
|
|
|
chmod a+r $DST/mirrors.txt
|
|
|
|
|
2016-04-09 14:18:35 +00:00
|
|
|
mkdir -p "$DST/ubuntu"
|
|
|
|
|
2016-04-08 21:24:53 +00:00
|
|
|
export GNUPGHOME="/etc/debmirror/ubuntu"
|
|
|
|
|
2020-02-15 17:55:25 +00:00
|
|
|
SOURCEOPT="--nosource"
|
|
|
|
if [[ ! -z "$UBUNTU_SOURCE_MIRROR" ]]; then
|
|
|
|
SOURCEOPT="--source"
|
|
|
|
fi
|
|
|
|
|
2016-04-08 20:41:48 +00:00
|
|
|
debmirror \
|
2020-02-15 17:55:25 +00:00
|
|
|
-a ${MIRROR_ARCHITECTURES} \
|
|
|
|
$SOURCEOPT \
|
|
|
|
-s ${MIRROR_CATEGORIES} \
|
|
|
|
-h ${UBUNTU_MIRROR_SOURCE} \
|
|
|
|
-d ${UBUNTU_MIRROR_PROJECTS} \
|
2016-04-11 00:54:41 +00:00
|
|
|
--ignore-small-errors \
|
2016-04-08 20:41:48 +00:00
|
|
|
-r /ubuntu \
|
2019-01-25 05:58:11 +00:00
|
|
|
--getcontents \
|
2016-04-08 20:41:48 +00:00
|
|
|
--progress \
|
|
|
|
--method=http \
|
|
|
|
$DST/ubuntu
|
|
|
|
|
2016-04-11 02:36:47 +00:00
|
|
|
chmod -R a+rX $DST
|