diff --git a/scripts/docker.sh b/scripts/docker.sh new file mode 100755 index 0000000..a3b2e69 --- /dev/null +++ b/scripts/docker.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +function sync_docker() { + repo_url="$1" + repo_dir="$2" + + [ ! -d "$repo_dir" ] && mkdir -p "$repo_dir" + cd $repo_dir + # lftp "${repo_url}/" -e "mirror --verbose --exclude-glob='*/SRPMS/*' -P 5 --delete --only-newer; bye" + # lftp "${repo_url}/" -e "mirror --verbose -P 5 --delete --only-newer; bye" + wget --mirror --convert-links --no-parent --no-host-directories $repo_url + find . -type f -iname "*.1" -exec rm {} \; +} + +sync_docker "http://apt.dockerproject.org/" "${TUNASYNC_WORKING_DIR}/apt" +sync_docker "http://yum.dockerproject.org/" "${TUNASYNC_WORKING_DIR}/yum" diff --git a/scripts/nodesource.sh b/scripts/nodesource.sh index 89c6c1f..8dda8e7 100644 --- a/scripts/nodesource.sh +++ b/scripts/nodesource.sh @@ -1,14 +1,18 @@ #!/bin/bash -function sync_repo_ck() { +function sync_nodesource() { repo_url="$1" repo_dir="$2" [ ! -d "$repo_dir" ] && mkdir -p "$repo_dir" cd $repo_dir - # lftp "${repo_url}/" -e "mirror --verbose --log=${TUNASYNC_LOG_FILE} --exclude-glob='*/SRPMS/*' -P 5 --delete --only-newer; bye" + # lftp "${repo_url}/" -e "mirror --verbose --exclude-glob='*/SRPMS/*' -P 5 --delete --only-newer; bye" lftp "${repo_url}/" -e "mirror --verbose -P 5 --delete --only-newer; bye" } -sync_repo_ck "https://deb.nodesource.com/node" "${TUNASYNC_WORKING_DIR}/deb" -sync_repo_ck "https://rpm.nodesource.com/pub" "${TUNASYNC_WORKING_DIR}/rpm" +sync_nodesource "https://deb.nodesource.com/node" "${TUNASYNC_WORKING_DIR}/deb" +sync_nodesource "https://deb.nodesource.com/node_0.12" "${TUNASYNC_WORKING_DIR}/deb_0.12" +sync_nodesource "https://deb.nodesource.com/node_4.x" "${TUNASYNC_WORKING_DIR}/deb_4.x" +sync_nodesource "https://rpm.nodesource.com/pub" "${TUNASYNC_WORKING_DIR}/rpm" +sync_nodesource "https://rpm.nodesource.com/pub_0.12" "${TUNASYNC_WORKING_DIR}/rpm_0.12" +sync_nodesource "https://rpm.nodesource.com/pub_4.x" "${TUNASYNC_WORKING_DIR}/rpm_4.x"