Last change
on this file since 216 was 7, checked in by Rick van der Zwet, 15 years ago |
Tricky to download base distribution
|
-
Property svn:executable
set to
*
|
File size:
995 bytes
|
Rev | Line | |
---|
[7] | 1 | #!/bin/sh
|
---|
| 2 | # Fetch the Base OS from a remote location
|
---|
| 3 | # Rick van der Zwet <info@rickvanderzwet.nl>
|
---|
| 4 |
|
---|
| 5 | OS_RELEASE=`sysctl -n kern.osrelease`
|
---|
| 6 | BASE_URL=ftp://ftp.nl.freebsd.org/pub/FreeBSD/releases/i386/${OS_RELEASE}
|
---|
| 7 | RSYNC_AVAILABLE=0
|
---|
| 8 |
|
---|
| 9 | rsync --version >/dev/null 2>/dev/null
|
---|
| 10 | if [ $? -eq 0 ]; then
|
---|
| 11 | RSYNC_AVAILABLE=1
|
---|
| 12 | fi
|
---|
| 13 |
|
---|
| 14 | for TYPE in kernels base manpages; do
|
---|
| 15 | mkdir -p os/$TYPE
|
---|
| 16 | if [ $RSYNC_AVAILABLE -eq 0 ]; then
|
---|
| 17 | echo -n "# fetching the binary $TYPE distribution using ftp ... "
|
---|
| 18 | # Quick hack to see we have downloaded all already
|
---|
| 19 | (cd os/$TYPE; md5 *) | grep -v 'CHECKSUM' | diff os/$TYPE/CHECKSUM.MD5 -
|
---|
| 20 | if [ $? -eq 0 ]; then
|
---|
| 21 | echo "DONE (already fully downloaded)"
|
---|
| 22 | else
|
---|
| 23 | (progress; cd os/$TYPE; echo 'mget *' | ftp -i $BASE_URL/$TYPE/) || exit 1
|
---|
| 24 | echo "DONE"
|
---|
| 25 | fi
|
---|
| 26 | else
|
---|
| 27 | echo -n "# fetching the binary $TYPE distribution using rsync ... "
|
---|
| 28 | rsync -az ftp.nl.freebsd.org::FreeBSD/releases/i386/${OS_RELEASE}/$TYPE os || exit 1
|
---|
| 29 | echo "DONE"
|
---|
| 30 | fi
|
---|
| 31 | done
|
---|
Note:
See
TracBrowser
for help on using the repository browser.