[ -d "${download_path}" ] || mkdir "${download_path}" cd "${download_path}" echo "Downloading to $download_path" ############################################################# ### This is the list method to be used with the -s switch ### ############################################################# if [[ "$method" == "list" ]] then cat $conf_path/$list | while read line do [ $(du -c $download_path | tail -n 1 | head -c -6) -lt $max_size ] || continue [ $(find $download_path | wc -l) -lt $max_files ] || continue