Rev | Line | |
---|
[1091] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | export http_proxy=http://proxy:3128
|
---|
| 4 | export ftp_proxy=http://proxy:3128
|
---|
| 5 |
|
---|
| 6 | NSCA_CMD="/usr/local/bin/nagios_send_nsca.sh"
|
---|
| 7 |
|
---|
| 8 | PROJECTS="
|
---|
| 9 | http://download.videolan.org/pub/vlc/SuSE/11.2/
|
---|
| 10 | http://download.videolan.org/pub/vlc/SuSE/12.1/
|
---|
| 11 | "
|
---|
| 12 |
|
---|
| 13 | # TODO:
|
---|
| 14 | # not working, because dir listings are forbidden
|
---|
| 15 | # http://download.nvidia.com/opensuse/11.2/
|
---|
| 16 | # (with hftp://download.nvidia.com/opensuse/11.2/ directory listings are possible,
|
---|
| 17 | # but file access in denied)
|
---|
| 18 |
|
---|
| 19 | SUCCESSFUL=""
|
---|
| 20 | FAILED=""
|
---|
| 21 |
|
---|
| 22 | DEST="/anlagen/vmlxlamp/repo/"
|
---|
| 23 |
|
---|
| 24 | cd $DEST
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | for url in $PROJECTS; do
|
---|
| 28 | echo $url
|
---|
| 29 | protocol=`sed -r "s|^([a-zA-Z]+)://.*|\1|" <<< $url`
|
---|
| 30 | host=`sed -r "s|^$protocol://([^/]+)/.*|\1|" <<< $url`
|
---|
| 31 | path=`sed -r "s|$protocol://$host||" <<< $url`
|
---|
| 32 | mkdir -p $host/$path
|
---|
| 33 | set -x
|
---|
| 34 | if ! lftp -c "open -e \"mirror --verbose=1 --continue --delete $path/. $DEST/$host/$path\" ${protocol}://${host}"; then
|
---|
| 35 | FAILED="$FAILED $url"
|
---|
| 36 | else
|
---|
| 37 | SUCCESS="$SUCCESS $url"
|
---|
| 38 | fi
|
---|
| 39 | set +x
|
---|
| 40 | done
|
---|
| 41 |
|
---|
| 42 | # adapt repository sources
|
---|
| 43 | for i in `find $DEST -name "*.repo" -a ! -name "vermkv-*.repo"`; do
|
---|
| 44 | basename=`basename $i`
|
---|
| 45 | dirname=`dirname $i`
|
---|
| 46 | sed "s|http://|http://install.vermkv/freigabe/|" $i > $dirname/vermkv-$basename
|
---|
| 47 | done
|
---|
| 48 |
|
---|
| 49 | /usr/local/sbin/mirror-report-errors.sh mirror-urls "$SUCCESS" "$FAILED"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.