Browse Source

- .server-files: allow to get multi images

master
vanhofen 6 years ago
parent
commit
604022537a
  1. 19
      .server-files/get-image.php

19
.server-files/get-image.php

@ -1,7 +1,7 @@
<?php
/*
Example:
http://www.neutrino-images.de/neutrino-images/get-image.php?boxtype=coolstream&boxmodel=kronos(&debug)
http://www.neutrino-images.de/neutrino-images/get-image.php?boxtype=coolstream&boxmodel=kronos(&debug)(&multi)
*/
$boxtype = trim($_GET["boxtype"]);
@ -30,6 +30,15 @@ if (isset($_GET["debug"]))
$debug = true;
}
$multi = false;
if (isset($_GET["multi"]))
{
$_multi = trim($_GET["multi"]);
$_multi = strtolower($_multi);
if ($_multi != "false" && $_multi != "no")
$multi = true;
}
if ($boxtype == "coolstream" || $boxtype == "cst")
{
# CST
@ -39,6 +48,12 @@ elseif ($boxtype == "armbox" || $boxtype == "arm")
{
# AX Tech
$boxtype_sc = "arm";
if ($multi)
{
$multi_str = "_multi_usb";
$image_ext = "zip";
}
else
$image_ext = "tgz";
}
@ -46,7 +61,7 @@ elseif ($boxtype == "armbox" || $boxtype == "arm")
$directory = $image_type;
if ($debug)
$directory .= "/debug";
$pattern = $directory . "/ni" . $image_version . "-" . $image_date . "-" . $boxtype_sc . "-" . $boxmodel . "." . $image_ext;
$pattern = $directory . "/ni" . $image_version . "-" . $image_date . "-" . $boxtype_sc . "-" . $boxmodel . $multi_str . "." . $image_ext;
# find last (newest) image
$last_mod = 0;

Loading…
Cancel
Save