All pastes #837569 Raw Edit

Anonymous

public text v1 · immutable
#837569 ·published 2007-12-29 19:54 UTC
rendered paste body
GetDlUrls() {

	echo "[$FUNCNAME]"

	URLSFILE="el_dlurls.txt"

	cd ~
	rm -rf "$URLSFILE"
	wget "http://www.duli.googlepages.com/$URLSFILE"
	if [ $? != 0 ]; then
	
		ErrMsg "Could not get download urls"
		return 1

	fi


	#Save previous IFS
	PREVIOUS_IFS=$IFS

	if [ ! -e ~/"$URLSFILE" ]; then

		ErrMsg "Download urls file does not exist"
		return 1

	fi

	#Populate arrays with package names and respective urls
	COUNT=0
	while IFS=';' read pkg url; do

		PKGS[$COUNT]="$pkg"
		URLS[$COUNT]="$url"
		let COUNT++

	done < ~/"$URLSFILE"

	#Restore previous IFS
	IFS=$PREVIOUS_IFS

	if [ -z "${!PKGS[@]}" ]; then

		return 1
	
	fi

}