Um aktuelle Patches vom RHN herunterzuladen, kann man sich Linux-Bordmitteln bedienen. Achtung: Die eingesetzte wget-Version muss cookies unterstützen (wget-1.10).
cookie holen und login
export WGET="/usr/bin/wget -q --cookies=on --keep-session-cookies --save-cookies=cookies.txt --load-cookies=cookies.txt --no-check-certificate" # cookie holen $WGET -O/dev/null 'https://rhn.redhat.com' # Login WGET -O/dev/null --post-data="username=$RHNUSERNAME&password=$RHNPASSWORD&login_cb=login" "https://rhn.redhat.com/rhn/LoginSubmit.do"
| x86 | ia32 | AMD64 / EM64T | z | ppc | |
| Red Hat Enterprise Linux ES (v. 4) | 2866 | 2890 | 2879 | ||
| Red Hat Enterprise Linux ES (v. 3) | 1187 | 1203 | 1218 | ||
| Red Hat Enterprise Linux ES (v. 2.1) | 675 | ||||
| Red Hat Enterprise Linux (v. 5) Beta | 6002 | 6012 | 6007 | 6019 | 6017 |
paketliste holen, ID=channelID und bereinigen
$WGET -Opkglist.html "https://rhn.redhat.com/network/software/channels/packages.pxt?cid=$ID&lower=1&upper=3000" grep "/network/software/packages/details.pxt" pkglist.html \ | sed -e 's/\(<a href=\"[^>]*\">\)\(.*\)<\/a>/\2:\1<\/a>/' \ > pkglist-stripped.txt
update needed ?
for pkg in $(cat pkglist-stripped.txt) do RPMPKG=$(echo $pkg| cut -f1 -d:) RPMCNT=$(find ../rpm-$ID -name $RPMPKG\*.rpm |wc -l) [[ "$RPMCNT" == "0" ]] && echo $pkg >> update-rpm.txt done
detail.pxt
$WGET -iupdate-rpm.txt -F -B https://rhn.redhat.com
alle download links in eine Datei
grep "Download Package" details.pxt* > rpms-to-fetch.html
download packages
$WGET -irpms-to-fetch.html --directory-prefix=$BASEDIR/rpm-$ID/ -F -N