source: dass-tools/usr/bin/mirror-urls.sh@ 1186

Last change on this file since 1186 was 1091, checked in by joergs, on Sep 7, 2012 at 10:46:02 AM

initial. from vermkv

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/bash
2
3export http_proxy=http://proxy:3128
4export ftp_proxy=http://proxy:3128
5
6NSCA_CMD="/usr/local/bin/nagios_send_nsca.sh"
7
8PROJECTS="
9http://download.videolan.org/pub/vlc/SuSE/11.2/
10http://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
19SUCCESSFUL=""
20FAILED=""
21
22DEST="/anlagen/vmlxlamp/repo/"
23
24cd $DEST
25
26
27for 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
40done
41
42# adapt repository sources
43for 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
47done
48
49/usr/local/sbin/mirror-report-errors.sh mirror-urls "$SUCCESS" "$FAILED"
Note: See TracBrowser for help on using the repository browser.