OpenVZ Forum


Home » General » HowTo » Simple script to download rpm files.
Simple script to download rpm files. [message #2392] Mon, 03 April 2006 01:32
jason is currently offline  jason
Messages: 1
Registered: April 2006
Junior Member
This is just a quick hack, I have been making a few test machines and got tired of cut/paste into putty to download utils and kernels.

vzfetch.sh:
#!/bin/bash
OPENVZ_KARCH="i686"
OPENVZ_UARCH="i386"
OPENVZ_SRC="/usr/local/src/openvz"

mkdir -p $OPENVZ_SRC/{kernel,util,template}

wget --quiet -O - http://openvz.org/download/kernel/ |  grep http:// | egrep "(${OPENVZ_KARCH}|noarch)"\.rpm | sed "s/.*http:/http:/; s/'>.*//g;" | xargs wget -c -P ${OPENVZ_SRC}/kernel/

wget --quiet -O - http://openvz.org/download/utils/ http://openvz.org/download/template/utils/ | grep http:// | grep "(${OPENVZ_UARCH}|noarch)"\.rpm | sed "s/.*http:/http:/; s/'>.*//g;" | xargs wget -c -P ${OPENVZ_SRC}/util/

wget --quiet -O - http://openvz.org/download/template/metadata/ | grep http:// | grep "(${OPENVZ_UARCH}|noarch)"\.rpm | sed "s/.*http:/http:/; s/'>.*//g;" | xargs wget -c -P ${OPENVZ_SRC}/template/




or oneliner:

wget --quiet -O - http://openvz.org/download/kernel/ http://openvz.org/download/utils/ http://openvz.org/download/template/utils/ http://openvz.org/download/template/metadata/ | egrep "http://.*(i386|i686|noarch)\.rpm" | sed "s/.*http:/http:/; s/'>.*//g;" | xargs -t wget -r -nH -c -P /usr/local/src/openvz


[Updated on: Mon, 03 April 2006 11:01]

Report message to a moderator

Previous Topic: Bandwidth Accounting for VPS
Next Topic: all vs. default in /proc/sys/net/ipv4/conf
Goto Forum:
  


Current Time: Sun Apr 28 15:47:31 GMT 2024

Total time taken to generate the page: 0.02208 seconds