From a8ec455783e179515782a3c6a5e53474af2eca59 Mon Sep 17 00:00:00 2001
From: Francis Rowe <info@gluglug.org.uk>
Date: Wed, 27 May 2015 13:16:27 -0400
Subject: download page: rsync mirrors now shown via function

---
(limited to 'site/functions.php')

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
+		}
 	}
 ?>
--
cgit v0.9.1