#!/bin/sh


copy_target()
{
	local src="$1"
	local dst="$2"
	rsync -auv --copy-unsafe-links "$src" "$dst"
	local name="$(basename "$src")"
	if [ -L "$dst/$name" ]; then
		local link="$(readlink "$dst/$name")"
		[ "$link" != "$name" ] || return 0
		copy_target "$(dirname "$src")/$link" "$dst/$(dirname "$link")/"
	fi
}

# Create the directory for PLESK_18_0_32
echo 'Create the directory for PLESK_18_0_32'
mkdir -p /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/

# Getting extensions
echo 'Getting extensions'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/extensions /var/www/mirrors/plesk-debian//

# Sync the microupdates directory for PLESK_18_0_32
echo 'Sync the microupdates directory for PLESK_18_0_32'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PSA_18.0.32_4963//microupdates /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/ 1>/dev/null 2>&1

# Sync the examiners directory for PLESK_18_0_32
echo 'Sync the examiners directory for PLESK_18_0_32'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PSA_18.0.32_4963//examiners /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/ 1>/dev/null 2>&1

# Sync the dists directory for PLESK_18_0_32
echo 'Sync the dists directory for PLESK_18_0_32'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PSA_18.0.32_4963//dists /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/ 1>/dev/null 2>&1

# Getting plesk_getkeyinfo.sh
echo 'Getting plesk_getkeyinfo.sh'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PSA_18.0.32_4963//plesk_getkeyinfo.sh /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/ 1>/dev/null 2>&1

# Getting Parallels_Installer
echo 'Getting Parallels_Installer'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/Parallels_Installer /var/www/mirrors/plesk-debian//

# Getting Installer
echo 'Getting Installer'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/Installer /var/www/mirrors/plesk-debian//

# Getting Plesk config for PLESK_18_0_32/deb10.0_x86_64
echo 'Getting Plesk config for PLESK_18_0_32/deb10.0_x86_64'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PSA_18.0.32_4963//plesk-18.0.32-deb10.0-x86_64.inf3 /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/

# Getting Plesk packages for PLESK_18_0_32/deb10.0_x86_64
echo 'Getting Plesk packages for PLESK_18_0_32/deb10.0_x86_64'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PSA_18.0.32_4963/dist-deb-Debian-10.0-x86_64 /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/

# Getting Plesk updates for PLESK_18_0_32/deb10.0_x86_64
echo 'Getting Plesk updates for PLESK_18_0_32/deb10.0_x86_64'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PSA_18.0.32_4963/update-deb-Debian-10.0-x86_64 /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/

# Getting Plesk thirdparty components for PLESK_18_0_32/deb10.0_x86_64
echo 'Getting Plesk thirdparty components for PLESK_18_0_32/deb10.0_x86_64'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PSA_18.0.32_4963/thirdparty-deb-Debian-10.0-x86_64 /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/

# Getting Plesk extra packages for PLESK_18_0_32/deb10.0_x86_64
echo 'Getting Plesk extra packages for PLESK_18_0_32/deb10.0_x86_64'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PSA_18.0.32_4963/extras-deb-Debian-10.0-x86_64 /var/www/mirrors/plesk-debian//pool/PSA_18.0.32_4963/

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/pool/PSA_18.0.32_4963 /var/www/mirrors/plesk-debian//debian//

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP_8_0
echo 'Getting the addon component PHP_8_0'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP80_17 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP80_17 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP80_17 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP72_17
echo 'Getting the addon component PHP72_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP_7.2.14 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP_7.2.14 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP_7.2.14 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP_7_4
echo 'Getting the addon component PHP_7_4'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP74_17 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP74_17 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP74_17 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP74_17
echo 'Getting the addon component PHP74_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PHP_7.4.8_59 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/pool/PHP_7.4.8_59 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/pool/PHP_7.4.8_59 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP_7_3
echo 'Getting the addon component PHP_7_3'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP73_17 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP73_17 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP73_17 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP73_17
echo 'Getting the addon component PHP73_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP_7.3.5 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP_7.3.5 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP_7.3.5 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP71_17
echo 'Getting the addon component PHP71_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/pool/PHP_7.1.33_96 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/pool/PHP_7.1.33_96 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/pool/PHP_7.1.33_96 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PPSB_17.8.12
echo 'Getting the addon component PPSB_17.8.12'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/SITEBUILDER_17.8.12 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/SITEBUILDER_17.8.12 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/SITEBUILDER_17.8.12 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP70_17
echo 'Getting the addon component PHP70_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP70_17 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP70_17 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP70_17 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP56_17
echo 'Getting the addon component PHP56_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP56_17 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP56_17 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP56_17 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP55_17
echo 'Getting the addon component PHP55_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP55_17 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP55_17 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP55_17 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP54_17
echo 'Getting the addon component PHP54_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP54_17 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP54_17 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP54_17 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP53_17
echo 'Getting the addon component PHP53_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP53_17 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP53_17 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP53_17 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

# Create the directory for Addons
echo 'Create the directory for Addons'
mkdir -p /var/www/mirrors/plesk-debian///

# Getting the addon component PHP52_17
echo 'Getting the addon component PHP52_17'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/PHP52_17 /var/www/mirrors/plesk-debian//

# Create the directory for Debian apt cache
echo 'Create the directory for Debian apt cache'
mkdir -p /var/www/mirrors/plesk-debian//debian//

# Create Debian apt cache
echo 'Create Debian apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/debian/PHP52_17 /var/www/mirrors/plesk-debian//debian// 1>/dev/null 2>&1

# Create the directory for Ubuntu apt cache
echo 'Create the directory for Ubuntu apt cache'
mkdir -p /var/www/mirrors/plesk-debian//ubuntu//

# Create Ubuntu apt cache
echo 'Create Ubuntu apt cache'
copy_target rsync://rsync.autoinstall.plesk.com/autoinstall/ubuntu/PHP52_17 /var/www/mirrors/plesk-debian//ubuntu// 1>/dev/null 2>&1

