diff options
author | Francis Rowe <info@gluglug.org.uk> | 2015-05-27 13:16:27 (EDT) |
---|---|---|
committer | Francis Rowe <info@gluglug.org.uk> | 2015-05-27 13:16:27 (EDT) |
commit | a8ec455783e179515782a3c6a5e53474af2eca59 (patch) | |
tree | bf111a97e603e3fd0f699b08f57106bbd929d222 /site | |
parent | 0e94461327c7c757793587703498b206934d0484 (diff) | |
download | libreboot.org-a8ec455783e179515782a3c6a5e53474af2eca59.zip libreboot.org-a8ec455783e179515782a3c6a5e53474af2eca59.tar.gz libreboot.org-a8ec455783e179515782a3c6a5e53474af2eca59.tar.bz2 |
download page: rsync mirrors now shown via function
Diffstat (limited to 'site')
-rw-r--r-- | site/download/index.php | 38 | ||||
-rw-r--r-- | site/functions.php | 29 | ||||
-rw-r--r-- | site/variables.php | 6 |
3 files changed, 33 insertions, 40 deletions
diff --git a/site/download/index.php b/site/download/index.php index 8de4669..750e604 100644 --- a/site/download/index.php +++ b/site/download/index.php @@ -107,7 +107,6 @@ </p> <h2 id="http">HTTP mirrors</h2> - <?php /* show HTTP mirrors */ echo mirrorList($lbHttpMirror, gettext("HTTP mirrors not added yet."),0,count($lbHttpMirror)); @@ -122,44 +121,17 @@ <div class="s"> - <h1 id="mirror"><?php echo gettext("Rsync mirrors (for mirroring libreboot)"); ?></h1> + <h1 id="mirror"><?php echo gettext("Mirroring libreboot (via rsync)"); ?></h1> <p> <?php echo gettext("Create a directory in your web server document root (e.g. libreboot/), and add one of these to your crontab:"); ?> </p> -<?php - if (count($lbRsyncServer)>0) { -?> - <h2><?php echo gettext("Main rsync mirror:"); ?></h2> - <p> - $ <b>rsync -avxP --delete --stats <?php echo $lbRsyncServer[0]; ?> /path/to/docroot/libreboot/</b> - </p> -<?php - if(count($lbRsyncServer)>1) { -?> - <h2><?php echo gettext("Backup rsync mirrors:"); ?></h2> - <p> -<?php - for ($server=1; $server<count($lbRsyncServer); $server++) { -?> - $ <b>rsync -avxP --delete --stats <?php echo $lbRsyncServer[$server]; ?> /path/to/docroot/libreboot/</b><br/> -<?php - } -?> - </p> -<?php - } - } else { -?> - <p> - <b><?php echo gettext("No mirrors available yet."); ?></b> - </p> -<?php - } -?> + <?php + echo rsyncList($lbRsyncServer, gettext("No mirrors available in this range."), 0, count($lbRsyncServer)); + ?> <p> - <?php echo gettext("Are you running a mirror? Contact the libreboot project (details are on the home page), and the link will be added here."); ?> + <?php echo gettext("Are you running a mirror? Contact the libreboot project (details are on the home page), and the link will be added on this page."); ?> </p> </div> diff --git a/site/functions.php b/site/functions.php index 0e20d2b..fb023b9 100644 --- a/site/functions.php +++ b/site/functions.php @@ -16,15 +16,12 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -?> -<?php /* Functions */ /* Generic function for showing a list of URLs */ function mirrorList($arrayMirrors,$strNotFoundMessage,$forIndexStart,$forIndexbelow) { -?> -<?php + if (count($arrayMirrors)>0) { for ($server=$forIndexStart; $server<$forIndexbelow; $server++) { ?> @@ -36,7 +33,31 @@ <p><?php echo $strNotFoundMessage; ?></p> <?php } + } + + /* List rsync mirroring instructions */ + function rsyncList($arrayRsync,$strNotFoundMessage,$forIndexStart,$forIndexBelow) { + if ( + count($arrayRsync)>0 && ($forIndexStart<=count($arrayRsync)-1) + && ($forIndexBelow<=count($arrayRsync)) && ($forIndexStart<=$forIndexBelow)) { + + for ($server=$forIndexStart; $server<$forIndexBelow; $server++) { +?> + <h2> + <?php echo $arrayRsync[$server][1]; ?> + </h2> + <p> + <b>rsync -avxP --delete --stats <?php echo $arrayRsync[$server][0]; ?> /path/to/docroot/libreboot/</b> + </p> +<?php + } + + } else { ?> + <p> + <?php echo $strNotFoundMessage; ?> + </p> <?php + } } ?> diff --git a/site/variables.php b/site/variables.php index 06b6f4b..1e67605 100644 --- a/site/variables.php +++ b/site/variables.php @@ -57,9 +57,9 @@ /* rsync servers (for release archives). Put the main one first */ $lbRsyncServer = array ( - "rsync.libreboot.org::mirrormirror", - "rsync://rsync.mirrorservice.org/libreboot.org/release/", - "rsync://ftp.linux.ro/libreboot/" + array("rsync.libreboot.org::mirrormirror","Libreboot Project (main rsync mirror)"), + array("rsync://rsync.mirrorservice.org/libreboot.org/release/","University of Kent, UK (backup mirror)"), + array("rsync://ftp.linux.ro/libreboot/","linux.ro, Romania (backup mirror)") ); /* Bug tracker URL */ |