1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
: ${BSDDIALOG_OK=0}
: ${BSDDIALOG_CANCEL=1}
: ${BSDDIALOG_HELP=2}
: ${BSDDIALOG_EXTRA=3}
: ${BSDDIALOG_ESC=5}
: ${BSDDIALOG_ERROR=255}
exec 5>&1
MIRROR=`bsddialog --backtitle "$OSNAME Installer" \
--title "Mirror Selection" --extra-button --extra-label "Other" \
--menu "Please select the best suitable site for you or \"other\" if you want to specify a different choice. The \"Main Site\" directs users to the nearest project managed mirror via GeoDNS (they carry the full range of possible distributions and support both IPv4 and IPv6). All other sites are known as \"Community Mirrors\"; not every site listed here carries more than the base distribution kits. Select a site!" \
0 0 16 \
http://ftp.freebsd.org "Main Site (GeoDNS, HTTP)"\
ftp://ftp.freebsd.org "Main Site (GeoDNS, FTP)"\
http://ftp.au.freebsd.org "Australia - IPv6"\
ftp://ftp3.au.freebsd.org "Australia #3"\
ftp://ftp.at.freebsd.org "Austria - IPv6"\
ftp://ftp2.br.freebsd.org "Brazil #2"\
ftp://ftp3.br.freebsd.org "Brazil #3"\
ftp://ftp.bg.freebsd.org "Bulgaria - IPv6"\
ftp://ftp.cz.freebsd.org "Czech Republic - IPv6"\
ftp://ftp.dk.freebsd.org "Denmark - IPv6"\
ftp://ftp.fi.freebsd.org "Finland"\
ftp://ftp.fr.freebsd.org "France - IPv6"\
ftp://ftp3.fr.freebsd.org "France #3"\
ftp://ftp6.fr.freebsd.org "France #6"\
ftp://ftp.de.freebsd.org "Germany - IPv6"\
ftp://ftp1.de.freebsd.org "Germany #1 - IPv6"\
ftp://ftp2.de.freebsd.org "Germany #2 - IPv6"\
ftp://ftp5.de.freebsd.org "Germany #5 - IPv6"\
ftp://ftp7.de.freebsd.org "Germany #7 - IPv6"\
ftp://ftp.gr.freebsd.org "Greece - IPv6"\
ftp://ftp2.gr.freebsd.org "Greece #2 - IPv6"\
ftp://ftp.jp.freebsd.org "Japan - IPv6"\
ftp://ftp2.jp.freebsd.org "Japan #2"\
ftp://ftp3.jp.freebsd.org "Japan #3"\
ftp://ftp4.jp.freebsd.org "Japan #4"\
ftp://ftp6.jp.freebsd.org "Japan #6 - IPv6"\
ftp://ftp.kr.freebsd.org "Korea"\
ftp://ftp2.kr.freebsd.org "Korea #2"\
ftp://ftp.lv.freebsd.org "Latvia"\
ftp://ftp.nl.freebsd.org "Netherlands - IPv6"\
ftp://ftp2.nl.freebsd.org "Netherlands #2"\
ftp://ftp.nz.freebsd.org "New Zealand"\
ftp://ftp.no.freebsd.org "Norway - IPv6"\
ftp://ftp.pl.freebsd.org "Poland - IPv6"\
ftp://ftp.ru.freebsd.org "Russia - IPv6"\
ftp://ftp2.ru.freebsd.org "Russia #2"\
ftp://ftp.si.freebsd.org "Slovenia - IPv6"\
ftp://ftp.za.freebsd.org "South Africa - IPv6"\
ftp://ftp2.za.freebsd.org "South Africa #2 - IPv6"\
ftp://ftp4.za.freebsd.org "South Africa #4"\
ftp://ftp.se.freebsd.org "Sweden - IPv6"\
ftp://ftp4.tw.freebsd.org "Taiwan #4"\
ftp://ftp5.tw.freebsd.org "Taiwan #5"\
ftp://ftp.uk.freebsd.org "UK - IPv6"\
ftp://ftp2.uk.freebsd.org "UK #2 - IPv6"\
ftp://ftp.ua.FreeBSD.org "Ukraine - IPv6"\
ftp://ftp5.us.freebsd.org "USA #5 - IPv6"\
2>&1 1>&5`
MIRROR_BUTTON=$?
exec 5>&-
_UNAME_R=`uname -r`
_UNAME_R=${_UNAME_R%-p*}
case ${_UNAME_R} in
*-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE)
RELDIR="snapshots"
;;
*)
RELDIR="releases"
;;
esac
BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}"
case $MIRROR_BUTTON in
$BSDDIALOG_ERROR | $BSDDIALOG_CANCEL | $BSDDIALOG_ESC)
exit 1
;;
$BSDDIALOG_OK)
;;
$BSDDIALOG_EXTRA)
exec 5>&1
BSDINSTALL_DISTSITE=`bsddialog --backtitle "$OSNAME Installer" \
--title "Mirror Selection" \
--inputbox "Please enter the URL to an alternate $OSNAME mirror:" \
0 74 "$BSDINSTALL_DISTSITE" 2>&1 1>&5`
MIRROR_BUTTON=$?
exec 5>&-
test $MIRROR_BUTTON -eq $BSDDIALOG_OK || exec $0 $@
;;
esac
export BSDINSTALL_DISTSITE
echo $BSDINSTALL_DISTSITE >&2
|