Browse Source

- server-files: update for hd6x recovery images

master
vanhofen 4 years ago
parent
commit
2519b7af4b
  1. 33
      .server-files/get-image.php
  2. 2
      .server-files/get-kernel.php

33
.server-files/get-image.php

@ -1,7 +1,7 @@
<?php <?php
/* /*
Example: Example:
http://www.neutrino-images.de/neutrino-images/get-image.php?boxtype=coolstream&boxmodel=kronos(&debug)(&mmc) http://www.neutrino-images.de/neutrino-images/get-image.php?boxtype=armbox&boxmodel=hd51(&debug)(&mmc)(&recovery)
*/ */
$boxtype = trim($_GET["boxtype"]); $boxtype = trim($_GET["boxtype"]);
@ -11,6 +11,7 @@ $boxmodel = trim($_GET["boxmodel"]);
$debug = false; $debug = false;
$mmc = false; $mmc = false;
$recovery = false;
if ($boxmodel == "hd60-mmc" || $boxmodel == "hd61-mmc") if ($boxmodel == "hd60-mmc" || $boxmodel == "hd61-mmc")
{ {
@ -24,11 +25,11 @@ if ($boxmodel == "hd60-mmc" || $boxmodel == "hd61-mmc")
$mmc = true; $mmc = true;
} }
$image_version = "???"; # wildcard for version (e.g. 320) $image_version = "???"; # wildcard for version (e.g. 320)
$image_date = "????????????"; # wildcard for date (e.g. 201601012359) $image_date = "????????????"; # wildcard for date (e.g. 201601012359)
$image_type = "nightly"; $image_type = "nightly";
$image_ext = "img";
$add_str = "";
# convert strings to lower case # convert strings to lower case
$boxtype = strtolower($boxtype); $boxtype = strtolower($boxtype);
@ -53,21 +54,35 @@ if (isset($_GET["mmc"]))
$mmc = true; $mmc = true;
} }
if (isset($_GET["recovery"]))
{
$_recovery = trim($_GET["recovery"]);
$_recovery = strtolower($_recovery);
if ($_recovery != "false" && $_recovery != "no")
$recovery = true;
}
if ($boxtype == "coolstream" || $boxtype == "cst") if ($boxtype == "coolstream" || $boxtype == "cst")
{ {
# CST
$boxtype_sc = "cst"; $boxtype_sc = "cst";
$image_ext = "img";
} }
elseif ($boxtype == "armbox" || $boxtype == "arm") elseif ($boxtype == "armbox" || $boxtype == "arm")
{ {
# AX Tech
$boxtype_sc = "arm"; $boxtype_sc = "arm";
if ($mmc) if ($mmc || $recovery)
{ {
if ($boxmodel == "hd60" || $boxmodel == "hd61") if ($boxmodel == "hd60" || $boxmodel == "hd61")
$mmc_str = "_single_mmc"; {
if ($mmc)
$add_str = "_single_mmc";
else else
$mmc_str = "_multi_usb"; $add_str = "_multi_recovery";
}
else
{
$add_str = "_multi_usb";
}
$image_ext = "zip"; $image_ext = "zip";
} }
else else
@ -78,7 +93,7 @@ elseif ($boxtype == "armbox" || $boxtype == "arm")
$directory = $image_type; $directory = $image_type;
if ($debug) if ($debug)
$directory .= "/debug"; $directory .= "/debug";
$pattern = $directory . "/ni" . $image_version . "-" . $image_date . "-" . $boxtype_sc . "-" . $boxmodel . $mmc_str . "." . $image_ext; $pattern = $directory . "/ni" . $image_version . "-" . $image_date . "-" . $boxtype_sc . "-" . $boxmodel . $add_str . "." . $image_ext;
# find last (newest) image # find last (newest) image
$last_mod = 0; $last_mod = 0;

2
.server-files/get-kernel.php

@ -1,7 +1,7 @@
<?php <?php
/* /*
Example: Example:
http://www.neutrino-images.de/neutrino-images/get-kernel.php?boxtype=coolstream&boxmodel=kronos http://www.neutrino-images.de/neutrino-images/get-kernel.php?boxtype=armbox&boxmodel=hd51
*/ */
$boxtype = trim($_GET["boxtype"]); $boxtype = trim($_GET["boxtype"]);

Loading…
Cancel
Save