#!/bin/sh
i='7'
for j in 7.1908 8.2003
do
	wget -c -r -np -nd -k -L -e robots=off -R "index.html*" -A "kernel-devel*" http://vault.centos.org/"$i.$j"/os/i386/RPMS/
	wget -c -r -np -nd -k -L -e robots=off -R "index.html*" -A "kernel-devel*" http://vault.centos.org/"$i.$j"/os/i386/Packages/
	wget -c -r -np -nd -k -L -e robots=off -R "index.html*" -A "kernel-devel*" http://vault.centos.org/"$i.$j"/os/x86_64/RPMS/
	wget -c -r -np -nd -k -L -e robots=off -R "index.html*" -A "kernel-devel*" http://vault.centos.org/"$i.$j"/os/x86_64/Packages/
	wget -c -r -np -nd -k -L -e robots=off -R "index.html*" -A "kernel-devel*" http://vault.centos.org/"$i.$j"/updates/i386/RPMS/
	wget -c -r -np -nd -k -L -e robots=off -R "index.html*" -A "kernel-devel*" http://vault.centos.org/"$i.$j"/updates/i386/Packages/
	wget -c -r -np -nd -k -L -e robots=off -R "index.html*" -A "kernel-devel*" http://vault.centos.org/"$i.$j"/updates/x86_64/RPMS/
	wget -c -r -np -nd -k -L -e robots=off -R "index.html*" -A "kernel-devel*" http://vault.centos.org/"$i.$j"/updates/x86_64/Packages/
	if [ ! -d "$i.$j" ];then
		mkdir "$i.$j"
	fi
	mv *.rpm "$i.$j"
done

