16dcef0cfSNathan Whitehorn#!/bin/sh 26dcef0cfSNathan Whitehorn#- 36dcef0cfSNathan Whitehorn# Copyright (c) 2011 Nathan Whitehorn 46dcef0cfSNathan Whitehorn# All rights reserved. 56dcef0cfSNathan Whitehorn# 66dcef0cfSNathan Whitehorn# Redistribution and use in source and binary forms, with or without 76dcef0cfSNathan Whitehorn# modification, are permitted provided that the following conditions 86dcef0cfSNathan Whitehorn# are met: 96dcef0cfSNathan Whitehorn# 1. Redistributions of source code must retain the above copyright 106dcef0cfSNathan Whitehorn# notice, this list of conditions and the following disclaimer. 116dcef0cfSNathan Whitehorn# 2. Redistributions in binary form must reproduce the above copyright 126dcef0cfSNathan Whitehorn# notice, this list of conditions and the following disclaimer in the 136dcef0cfSNathan Whitehorn# documentation and/or other materials provided with the distribution. 146dcef0cfSNathan Whitehorn# 156dcef0cfSNathan Whitehorn# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 166dcef0cfSNathan Whitehorn# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 176dcef0cfSNathan Whitehorn# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 186dcef0cfSNathan Whitehorn# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 196dcef0cfSNathan Whitehorn# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 206dcef0cfSNathan Whitehorn# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 216dcef0cfSNathan Whitehorn# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 226dcef0cfSNathan Whitehorn# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 236dcef0cfSNathan Whitehorn# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 246dcef0cfSNathan Whitehorn# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 256dcef0cfSNathan Whitehorn# SUCH DAMAGE. 266dcef0cfSNathan Whitehorn# 276dcef0cfSNathan Whitehorn 28cc42ef53SBrad DavisBSDCFG_SHARE="/usr/share/bsdconfig" 29cc42ef53SBrad Davis. $BSDCFG_SHARE/common.subr || exit 1 30cc42ef53SBrad Davis 31bbddd888SAlfonso S. Siciliano: ${BSDDIALOG_OK=0} 32bbddd888SAlfonso S. Siciliano: ${BSDDIALOG_CANCEL=1} 33bbddd888SAlfonso S. Siciliano: ${BSDDIALOG_HELP=2} 34bbddd888SAlfonso S. Siciliano: ${BSDDIALOG_EXTRA=3} 35bbddd888SAlfonso S. Siciliano: ${BSDDIALOG_ESC=5} 36bbddd888SAlfonso S. Siciliano: ${BSDDIALOG_ERROR=255} 376dcef0cfSNathan Whitehorn 38c0e249d3SLars Kellogg-Stedmanexec 5>&1 39cc42ef53SBrad DavisMIRROR=`bsddialog --backtitle "$OSNAME Installer" \ 406dcef0cfSNathan Whitehorn --title "Mirror Selection" --extra-button --extra-label "Other" \ 41591e2911SDanilo G. Baio --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!" \ 42bbddd888SAlfonso S. Siciliano 0 0 16 \ 43*9c599881SPhilip Paeps http://ftp.freebsd.org "Main Site (GeoDNS, HTTP)"\ 44*9c599881SPhilip Paeps ftp://ftp.freebsd.org "Main Site (GeoDNS, FTP)"\ 45591e2911SDanilo G. Baio http://ftp.au.freebsd.org "Australia - IPv6"\ 466dcef0cfSNathan Whitehorn ftp://ftp3.au.freebsd.org "Australia #3"\ 47591e2911SDanilo G. Baio ftp://ftp.at.freebsd.org "Austria - IPv6"\ 486dcef0cfSNathan Whitehorn ftp://ftp2.br.freebsd.org "Brazil #2"\ 496dcef0cfSNathan Whitehorn ftp://ftp3.br.freebsd.org "Brazil #3"\ 50591e2911SDanilo G. Baio ftp://ftp.bg.freebsd.org "Bulgaria - IPv6"\ 51591e2911SDanilo G. Baio ftp://ftp.cz.freebsd.org "Czech Republic - IPv6"\ 52591e2911SDanilo G. Baio ftp://ftp.dk.freebsd.org "Denmark - IPv6"\ 536dcef0cfSNathan Whitehorn ftp://ftp.fi.freebsd.org "Finland"\ 54591e2911SDanilo G. Baio ftp://ftp.fr.freebsd.org "France - IPv6"\ 556dcef0cfSNathan Whitehorn ftp://ftp3.fr.freebsd.org "France #3"\ 566dcef0cfSNathan Whitehorn ftp://ftp6.fr.freebsd.org "France #6"\ 57591e2911SDanilo G. Baio ftp://ftp.de.freebsd.org "Germany - IPv6"\ 58591e2911SDanilo G. Baio ftp://ftp1.de.freebsd.org "Germany #1 - IPv6"\ 59591e2911SDanilo G. Baio ftp://ftp2.de.freebsd.org "Germany #2 - IPv6"\ 60591e2911SDanilo G. Baio ftp://ftp5.de.freebsd.org "Germany #5 - IPv6"\ 61591e2911SDanilo G. Baio ftp://ftp7.de.freebsd.org "Germany #7 - IPv6"\ 62591e2911SDanilo G. Baio ftp://ftp.gr.freebsd.org "Greece - IPv6"\ 63591e2911SDanilo G. Baio ftp://ftp2.gr.freebsd.org "Greece #2 - IPv6"\ 64591e2911SDanilo G. Baio ftp://ftp.jp.freebsd.org "Japan - IPv6"\ 656dcef0cfSNathan Whitehorn ftp://ftp2.jp.freebsd.org "Japan #2"\ 666dcef0cfSNathan Whitehorn ftp://ftp3.jp.freebsd.org "Japan #3"\ 676dcef0cfSNathan Whitehorn ftp://ftp4.jp.freebsd.org "Japan #4"\ 68591e2911SDanilo G. Baio ftp://ftp6.jp.freebsd.org "Japan #6 - IPv6"\ 696dcef0cfSNathan Whitehorn ftp://ftp.kr.freebsd.org "Korea"\ 706dcef0cfSNathan Whitehorn ftp://ftp2.kr.freebsd.org "Korea #2"\ 71a6df4068SGavin Atkinson ftp://ftp.lv.freebsd.org "Latvia"\ 72591e2911SDanilo G. Baio ftp://ftp.nl.freebsd.org "Netherlands - IPv6"\ 736dcef0cfSNathan Whitehorn ftp://ftp2.nl.freebsd.org "Netherlands #2"\ 74a6df4068SGavin Atkinson ftp://ftp.nz.freebsd.org "New Zealand"\ 75591e2911SDanilo G. Baio ftp://ftp.no.freebsd.org "Norway - IPv6"\ 76591e2911SDanilo G. Baio ftp://ftp.pl.freebsd.org "Poland - IPv6"\ 77591e2911SDanilo G. Baio ftp://ftp.ru.freebsd.org "Russia - IPv6"\ 786dcef0cfSNathan Whitehorn ftp://ftp2.ru.freebsd.org "Russia #2"\ 79591e2911SDanilo G. Baio ftp://ftp.si.freebsd.org "Slovenia - IPv6"\ 80591e2911SDanilo G. Baio ftp://ftp.za.freebsd.org "South Africa - IPv6"\ 81591e2911SDanilo G. Baio ftp://ftp2.za.freebsd.org "South Africa #2 - IPv6"\ 826dcef0cfSNathan Whitehorn ftp://ftp4.za.freebsd.org "South Africa #4"\ 83591e2911SDanilo G. Baio ftp://ftp.se.freebsd.org "Sweden - IPv6"\ 846dcef0cfSNathan Whitehorn ftp://ftp4.tw.freebsd.org "Taiwan #4"\ 85591e2911SDanilo G. Baio ftp://ftp5.tw.freebsd.org "Taiwan #5"\ 86591e2911SDanilo G. Baio ftp://ftp.uk.freebsd.org "UK - IPv6"\ 87591e2911SDanilo G. Baio ftp://ftp2.uk.freebsd.org "UK #2 - IPv6"\ 88591e2911SDanilo G. Baio ftp://ftp.ua.FreeBSD.org "Ukraine - IPv6"\ 89591e2911SDanilo G. Baio ftp://ftp5.us.freebsd.org "USA #5 - IPv6"\ 90c0e249d3SLars Kellogg-Stedman 2>&1 1>&5` 916dcef0cfSNathan WhitehornMIRROR_BUTTON=$? 92c0e249d3SLars Kellogg-Stedmanexec 5>&- 936dcef0cfSNathan Whitehorn 9439d4f2c6SGlen Barber_UNAME_R=`uname -r` 95a382af08SDag-Erling Smørgrav_UNAME_R=${_UNAME_R%-p*} 9639d4f2c6SGlen Barber 9739d4f2c6SGlen Barbercase ${_UNAME_R} in 982ba8b5b3SGlen Barber *-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE) 9939d4f2c6SGlen Barber RELDIR="snapshots" 10039d4f2c6SGlen Barber ;; 10139d4f2c6SGlen Barber *) 10239d4f2c6SGlen Barber RELDIR="releases" 10339d4f2c6SGlen Barber ;; 10439d4f2c6SGlen Barberesac 10539d4f2c6SGlen Barber 10639d4f2c6SGlen BarberBSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}" 1076dcef0cfSNathan Whitehorn 1086dcef0cfSNathan Whitehorncase $MIRROR_BUTTON in 109bbddd888SAlfonso S. Siciliano$BSDDIALOG_ERROR | $BSDDIALOG_CANCEL | $BSDDIALOG_ESC) 1106dcef0cfSNathan Whitehorn exit 1 1116dcef0cfSNathan Whitehorn ;; 112bbddd888SAlfonso S. Siciliano$BSDDIALOG_OK) 1136dcef0cfSNathan Whitehorn ;; 114bbddd888SAlfonso S. Siciliano$BSDDIALOG_EXTRA) 115c0e249d3SLars Kellogg-Stedman exec 5>&1 116cc42ef53SBrad Davis BSDINSTALL_DISTSITE=`bsddialog --backtitle "$OSNAME Installer" \ 1176dcef0cfSNathan Whitehorn --title "Mirror Selection" \ 118cc42ef53SBrad Davis --inputbox "Please enter the URL to an alternate $OSNAME mirror:" \ 119c0e249d3SLars Kellogg-Stedman 0 74 "$BSDINSTALL_DISTSITE" 2>&1 1>&5` 1206dcef0cfSNathan Whitehorn MIRROR_BUTTON=$? 121c0e249d3SLars Kellogg-Stedman exec 5>&- 122bbddd888SAlfonso S. Siciliano test $MIRROR_BUTTON -eq $BSDDIALOG_OK || exec $0 $@ 1236dcef0cfSNathan Whitehorn ;; 1246dcef0cfSNathan Whitehornesac 1256dcef0cfSNathan Whitehorn 1266dcef0cfSNathan Whitehornexport BSDINSTALL_DISTSITE 1276dcef0cfSNathan Whitehornecho $BSDINSTALL_DISTSITE >&2 128