1#!/bin/sh 2#- 3# Copyright (c) 2011 Nathan Whitehorn 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 9# 1. Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 2. Redistributions in binary form must reproduce the above copyright 12# notice, this list of conditions and the following disclaimer in the 13# documentation and/or other materials provided with the distribution. 14# 15# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25# SUCH DAMAGE. 26# 27# $FreeBSD$ 28 29: ${DIALOG_OK=0} 30: ${DIALOG_CANCEL=1} 31: ${DIALOG_HELP=2} 32: ${DIALOG_EXTRA=3} 33: ${DIALOG_ITEM_HELP=4} 34: ${DIALOG_ESC=255} 35 36exec 3>&1 37MIRROR=`dialog --backtitle "FreeBSD Installer" \ 38 --title "Mirror Selection" --extra-button --extra-label "Other" \ 39 --menu "Please select the site closest to you or \"other\" if you'd like to specify a different choice. Also note that not every site listed here carries more than the base distribution kits. Only Primary sites are guaranteed to carry the full range of possible distributions. Select a site that's close!" \ 40 0 0 0 \ 41 ftp://ftp.freebsd.org "Main Site"\ 42 ftp://ftp.freebsd.org "IPv6 Main Site"\ 43 ftp://ftp3.ie.freebsd.org "IPv6 Ireland"\ 44 ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ 45 ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ 46 ftp://ftp4.us.freebsd.org "IPv6 USA"\ 47 ftp://ftp1.freebsd.org "Primary"\ 48 ftp://ftp2.freebsd.org "Primary #2"\ 49 ftp://ftp3.freebsd.org "Primary #3"\ 50 ftp://ftp4.freebsd.org "Primary #4"\ 51 ftp://ftp5.freebsd.org "Primary #5"\ 52 ftp://ftp6.freebsd.org "Primary #6"\ 53 ftp://ftp7.freebsd.org "Primary #7"\ 54 ftp://ftp10.freebsd.org "Primary #10"\ 55 ftp://ftp11.freebsd.org "Primary #11"\ 56 ftp://ftp12.freebsd.org "Primary #12"\ 57 ftp://ftp13.freebsd.org "Primary #13"\ 58 ftp://ftp14.freebsd.org "Primary #14"\ 59 ftp://ftp.au.freebsd.org "Australia"\ 60 ftp://ftp2.au.freebsd.org "Australia #2"\ 61 ftp://ftp3.au.freebsd.org "Australia #3"\ 62 ftp://ftp.at.freebsd.org "Austria"\ 63 ftp://ftp2.br.freebsd.org "Brazil #2"\ 64 ftp://ftp3.br.freebsd.org "Brazil #3"\ 65 ftp://ftp4.br.freebsd.org "Brazil #4"\ 66 ftp://ftp.bg.freebsd.org "Bulgaria"\ 67 ftp://ftp.cn.freebsd.org "China"\ 68 ftp://ftp.cz.freebsd.org "Czech Republic"\ 69 ftp://ftp.dk.freebsd.org "Denmark"\ 70 ftp://ftp.fi.freebsd.org "Finland"\ 71 ftp://ftp.fr.freebsd.org "France"\ 72 ftp://ftp3.fr.freebsd.org "France #3"\ 73 ftp://ftp4.fr.freebsd.org "IPv6 France #4"\ 74 ftp://ftp5.fr.freebsd.org "France #5"\ 75 ftp://ftp6.fr.freebsd.org "France #6"\ 76 ftp://ftp7.fr.freebsd.org "France #7"\ 77 ftp://ftp8.fr.freebsd.org "IPv6 France #8"\ 78 ftp://ftp.de.freebsd.org "Germany"\ 79 ftp://ftp2.de.freebsd.org "Germany #2"\ 80 ftp://ftp4.de.freebsd.org "Germany #4"\ 81 ftp://ftp5.de.freebsd.org "Germany #5"\ 82 ftp://ftp7.de.freebsd.org "Germany #7"\ 83 ftp://ftp8.de.freebsd.org "Germany #8"\ 84 ftp://ftp.gr.freebsd.org "Greece"\ 85 ftp://ftp2.gr.freebsd.org "Greece #2"\ 86 ftp://ftp3.ie.freebsd.org "Ireland #3"\ 87 ftp://ftp.jp.freebsd.org "Japan"\ 88 ftp://ftp2.jp.freebsd.org "Japan #2"\ 89 ftp://ftp3.jp.freebsd.org "Japan #3"\ 90 ftp://ftp4.jp.freebsd.org "Japan #4"\ 91 ftp://ftp5.jp.freebsd.org "Japan #5"\ 92 ftp://ftp6.jp.freebsd.org "Japan #6"\ 93 ftp://ftp7.jp.freebsd.org "Japan #7"\ 94 ftp://ftp8.jp.freebsd.org "Japan #8"\ 95 ftp://ftp9.jp.freebsd.org "Japan #9"\ 96 ftp://ftp.kr.freebsd.org "Korea"\ 97 ftp://ftp2.kr.freebsd.org "Korea #2"\ 98 ftp://ftp.lv.freebsd.org "Latvia"\ 99 ftp://ftp.nl.freebsd.org "Netherlands"\ 100 ftp://ftp2.nl.freebsd.org "Netherlands #2"\ 101 ftp://ftp.nz.freebsd.org "New Zealand"\ 102 ftp://ftp.no.freebsd.org "Norway"\ 103 ftp://ftp.pl.freebsd.org "Poland"\ 104 ftp://ftp.ru.freebsd.org "Russia"\ 105 ftp://ftp2.ru.freebsd.org "Russia #2"\ 106 ftp://ftp5.ru.freebsd.org "Russia #5"\ 107 ftp://ftp6.ru.freebsd.org "Russia #6"\ 108 ftp://ftp.sk.freebsd.org "Slovak Republic"\ 109 ftp://ftp2.sk.freebsd.org "Slovak Republic #2"\ 110 ftp://ftp.si.freebsd.org "Slovenia"\ 111 ftp://ftp.za.freebsd.org "South Africa"\ 112 ftp://ftp2.za.freebsd.org "South Africa #2"\ 113 ftp://ftp4.za.freebsd.org "South Africa #4"\ 114 ftp://ftp.se.freebsd.org "Sweden"\ 115 ftp://ftp4.se.freebsd.org "Sweden #4"\ 116 ftp://ftp.ch.freebsd.org "Switzerland"\ 117 ftp://ftp.tw.freebsd.org "Taiwan"\ 118 ftp://ftp2.tw.freebsd.org "Taiwan #2"\ 119 ftp://ftp3.tw.freebsd.org "Taiwan #3"\ 120 ftp://ftp4.tw.freebsd.org "Taiwan #4"\ 121 ftp://ftp6.tw.freebsd.org "Taiwan #6"\ 122 ftp://ftp11.tw.freebsd.org "Taiwan #11"\ 123 ftp://ftp.uk.freebsd.org "UK"\ 124 ftp://ftp2.uk.freebsd.org "UK #2"\ 125 ftp://ftp3.uk.freebsd.org "UK #3"\ 126 ftp://ftp4.uk.freebsd.org "UK #4"\ 127 ftp://ftp5.uk.freebsd.org "UK #5"\ 128 ftp://ftp.ua.freebsd.org "Ukraine"\ 129 ftp://ftp1.us.freebsd.org "USA #1"\ 130 ftp://ftp2.us.freebsd.org "USA #2"\ 131 ftp://ftp3.us.freebsd.org "USA #3"\ 132 ftp://ftp4.us.freebsd.org "USA #4"\ 133 ftp://ftp5.us.freebsd.org "USA #5"\ 134 ftp://ftp6.us.freebsd.org "USA #6"\ 135 ftp://ftp8.us.freebsd.org "USA #8"\ 136 ftp://ftp10.us.freebsd.org "USA #10"\ 137 ftp://ftp11.us.freebsd.org "USA #11"\ 138 ftp://ftp13.us.freebsd.org "USA #13"\ 139 ftp://ftp14.us.freebsd.org "USA #14"\ 140 ftp://ftp15.us.freebsd.org "USA #15"\ 141 2>&1 1>&3` 142MIRROR_BUTTON=$? 143exec 3>&- 144 145_UNAME_R=`uname -r` 146_UNAME_R=${_UNAME_R%-p*} 147 148case ${_UNAME_R} in 149 *-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE) 150 RELDIR="snapshots" 151 ;; 152 *) 153 RELDIR="releases" 154 ;; 155esac 156 157BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}" 158 159case $MIRROR_BUTTON in 160$DIALOG_CANCEL) 161 exit 1 162 ;; 163$DIALOG_OK) 164 ;; 165$DIALOG_EXTRA) 166 exec 3>&1 167 BSDINSTALL_DISTSITE=`dialog --backtitle "FreeBSD Installer" \ 168 --title "Mirror Selection" \ 169 --inputbox "Please enter the URL to an alternate FreeBSD mirror:" \ 170 0 0 "$BSDINSTALL_DISTSITE" 2>&1 1>&3` 171 MIRROR_BUTTON=$? 172 exec 3>&- 173 test $MIRROR_BUTTON -eq 0 || exec $0 $@ 174 ;; 175esac 176 177export BSDINSTALL_DISTSITE 178echo $BSDINSTALL_DISTSITE >&2 179