Fixed boot.php script
This commit is contained in:
parent
ef4e30b324
commit
53370f6adf
@ -1,6 +1,6 @@
|
||||
Summary: LibreSchool PXE server
|
||||
Name: libreschool-pxeserver
|
||||
Version: 1.1.0
|
||||
Version: 1.1.1
|
||||
Release: 1.ns7
|
||||
License: GPL
|
||||
BuildArch: noarch
|
||||
@ -112,6 +112,9 @@ if [ "$1" = 0 ]; then
|
||||
fi
|
||||
|
||||
%changelog
|
||||
* Fri Apr 3 2020 Paolo Asperti <paolo@asperti.com> - 1.1.1-1.ns7
|
||||
- Fixed boot.php script
|
||||
|
||||
* Wed Apr 1 2020 Paolo Asperti <paolo@asperti.com> - 1.1.0-1.ns7
|
||||
- Added a lot of PXE images
|
||||
- Added iso download and check script
|
||||
|
@ -76,6 +76,7 @@ function getClientFromMAC($mac=false) {
|
||||
*/
|
||||
function defaultExit() {
|
||||
print("#!ipxe
|
||||
# reload with mac address
|
||||
chain http://".$_SERVER['HTTP_HOST'].$_SERVER["SCRIPT_NAME"]."?mac=\${mac}
|
||||
");
|
||||
exit();
|
||||
@ -94,8 +95,9 @@ function imageExists($i) {
|
||||
$dir = $pwd . '/' . $i;
|
||||
$bootfile = $dir . '/boot';
|
||||
$iso_is_mounted = $dir . '/iso_is_mounted';
|
||||
return is_dir($dir) && is_readable($bootfile) &&
|
||||
is_link($iso_is_mounted) && is_readable($iso_is_mounted);
|
||||
$iso_ok = ! file_exists($iso_is_mounted) ||
|
||||
(is_link($iso_is_mounted) && is_readable($iso_is_mounted));
|
||||
return is_dir($dir) && is_readable($bootfile) && $iso_ok;
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST['mac'])) {
|
||||
@ -118,6 +120,7 @@ if (isset($client['PXEImageOneTime']) && !empty($client['PXEImageOneTime'])) {
|
||||
// try to boot the OneTime image
|
||||
if (imageExists($client['PXEImageOneTime'])) {
|
||||
print("#!ipxe
|
||||
# Loading PXEImageOneTime
|
||||
chain " . $client['PXEImageOneTime'] . "/boot
|
||||
");
|
||||
$props = array(
|
||||
@ -132,6 +135,7 @@ if (isset($client['PXEImage']) && !empty($client['PXEImage'])) {
|
||||
// try to boot the standard image
|
||||
if (imageExists($client['PXEImage'])) {
|
||||
print("#!ipxe
|
||||
# Loading PXEImage
|
||||
chain " . $client['PXEImage'] . "/boot
|
||||
");
|
||||
exit();
|
||||
@ -139,5 +143,6 @@ if (isset($client['PXEImage']) && !empty($client['PXEImage'])) {
|
||||
}
|
||||
|
||||
print("#!ipxe
|
||||
# catchall
|
||||
chain localhd/boot
|
||||
");
|
||||
|
Loading…
x
Reference in New Issue
Block a user