diff --git a/default/home/Scripts/iso_updater.sh b/default/home/Scripts/iso_updater.sh index 88b11c4..8bc62f3 100755 --- a/default/home/Scripts/iso_updater.sh +++ b/default/home/Scripts/iso_updater.sh @@ -6,8 +6,12 @@ iso_download(){ # $2 = iso filename # $3 = iso path printf '\n\nDownloading %s...\n' "${2}" - printf 'url: %s%s' "${1}" "${2}" + printf 'url: %s\n' "${1}" printf 'destination file: %s%s\n' "${3}" "${2}" + if [ ! -f "${3}${2}" ];then + mkdir -p "${3}" + curl --progress-bar -Lo "${3}${2}" "${1}" + fi } #debian stable @@ -15,13 +19,12 @@ debian_stable_iso_root='cdimage.debian.org/debian-cd/current-live/amd64/iso-hybr debian_stable_iso_list=$(curl -s "ftp://${debian_stable_iso_root}" | grep '.iso$' | awk '{print $9}' | grep -e 'kde' -e 'standard' -e 'lxqt' -e 'xfce') for i in ${debian_stable_iso_list[@]};do - iso_download "http://${debian_stable_iso_root}${i}" "${i}" "disk_images/operating_systems/linux/debian/" + iso_download "http://${debian_stable_iso_root}${i}" "${i}" "disk_images/operating_systems/linux/debian/stable/" done debian_testing_iso_root='cdimage.debian.org/cdimage/weekly-live-builds/amd64/iso-hybrid/' debian_testing_iso_list=$(curl -s "ftp://${debian_testing_iso_root}" | grep '.iso$' | awk '{print $9}' | grep -e 'standard') for i in ${debian_testing_iso_list[@]};do - printf '\n\nDownloading %s...\n' "${i}" - iso_download "http://${debian_testing_iso_root}${i}" "${i}" "" + iso_download "http://${debian_testing_iso_root}${i}" "${i}" "disk_images/operating_systems/linux/debian/testing_$(date +%Y-%m-%d)/" done