mirror script
This commit is contained in:
parent
b6bd6159de
commit
9d36ea1a4e
1 changed files with 20 additions and 0 deletions
20
md1.komreg.net/overlay/usr/local/bin/mirror-mdq.sh
Executable file
20
md1.komreg.net/overlay/usr/local/bin/mirror-mdq.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
base=$1
|
||||
target=$2
|
||||
dir=`mktemp -d`
|
||||
|
||||
function cleanup() {
|
||||
rm -rf $dir
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
mkdir -p $target && (
|
||||
cd $dir
|
||||
WGET_ARGS="--mirror --no-host-directories -q"
|
||||
idx_obj=".well-known/webfinger?rel=urn:oasis:names:tc:SAML:2.0:metadata"
|
||||
wget $WGET_ARGS "$base/$idx_obj" && jq -r '.links[].href' < "$idx_obj" | wget $WGET_ARGS -i -
|
||||
)
|
||||
|
||||
rsync -az --delete $dir/ $target/
|
Loading…
Add table
Reference in a new issue