I have following package repository format
Package: enigma2-plugin-extensions-airplayer
Version: 0.3.9
Section: extra
Architecture: all
Maintainer: hellmaster1024 and DonDavici <hellmaster1024 and DonDavici@code.google.com/p/airplayer/>
MD5Sum: b0c862e749846521ea11eeae77ddf905
Size: 166268
Filename: enigma2-plugin-extensions-airplayer_0.3.9_mips32el.ipk
Source: ftp://code.google.com/p/airplayer//hellmaster1024 and DonDavici/airplayer-0.3.9.tar.gz
Description: Enigma2 Plugin AirPlayer by hellmaster1024 and DonDavici
OE: airplayer-0.3.9
HomePage: code.google.com/p/airplayer/
Priority: optional
Package: enigma2-plugin-extensions-atmolightd
Version: 0.7-pre22
Section: extra
Architecture: all
Maintainer: mamba0815 <mamba0815@gmx.li>
MD5Sum: af17593ec8ad4a00c1fa843ccb17be6f
Size: 851522
Filename: enigma2-plugin-extensions-atmolightd_0.7-pre22_all.ipk
Source: www.noip.com
Description: Sedulight/Atmolight/amBXlight/Karatelight for Enigma2
OE: 1.6
HomePage: http://www.i-have-a-dreambox.com/wbb2/thread.php?threadid=136415
Priority: optional
Now I need a bash script which finds in a Loop the "Package Name" example "enigma2-plugin-extensions-atmolightd" and the "Filename" example enigma2-plugin-extensions-atmolightd_0.7-pre22_all.ipk
I started with following script
for i in `cat Packages.txt |grep Filename|cut -b 11-`; do
wget "http://sources.dreamboxupdate.com/opendreambox/1.5/dm7025/feed/$i";
done
I can download all the packages - but I miss the Package Name. Want to create a folder with the Package Name and then store all versions of the packages into this folder.
For sure this can be solved with Regex? But I am not good at this,...
Greet`s erich
My final solution
#!/bin/bash
#
echo "Downloading all Packages from the feed"
rootPath="/tmp/Openwrt/Trunk"
#echo $rootPath
mkdir -p $rootPath
wget -O "$rootPath/Packages" http://enigma2.world-of-satellite.com/feeds/3.0/et9x00/3rdparty/Packages
while read -r p f; do
mkdir -p "$rootPath/$p" 2>/dev/null
wget -nc -P "$rootPath/$p" "http://enigma2.world-of-satellite.com/feeds/3.0/et9x00/3rdparty/$f"
done < <(awk -F ' *: *' '$1=="Package"{p=$2;next} $1=="Filename"{print p, $2}' "$rootPath/Packages")