diff --git a/libreschool-pxeserver.spec b/libreschool-pxeserver.spec index ae3661c..878ff6a 100644 --- a/libreschool-pxeserver.spec +++ b/libreschool-pxeserver.spec @@ -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 - 1.1.1-1.ns7 +- Fixed boot.php script + * Wed Apr 1 2020 Paolo Asperti - 1.1.0-1.ns7 - Added a lot of PXE images - Added iso download and check script diff --git a/root/srv/ipxe/boot.php b/root/srv/ipxe/boot.php index e3d0493..5f0defa 100644 --- a/root/srv/ipxe/boot.php +++ b/root/srv/ipxe/boot.php @@ -76,7 +76,8 @@ function getClientFromMAC($mac=false) { */ function defaultExit() { print("#!ipxe - chain http://".$_SERVER['HTTP_HOST'].$_SERVER["SCRIPT_NAME"]."?mac=\${mac} +# 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,7 +120,8 @@ if (isset($client['PXEImageOneTime']) && !empty($client['PXEImageOneTime'])) { // try to boot the OneTime image if (imageExists($client['PXEImageOneTime'])) { print("#!ipxe - chain " . $client['PXEImageOneTime'] . "/boot +# Loading PXEImageOneTime +chain " . $client['PXEImageOneTime'] . "/boot "); $props = array( 'PXEImageOneTime' => '' @@ -132,12 +135,14 @@ if (isset($client['PXEImage']) && !empty($client['PXEImage'])) { // try to boot the standard image if (imageExists($client['PXEImage'])) { print("#!ipxe - chain " . $client['PXEImage'] . "/boot +# Loading PXEImage +chain " . $client['PXEImage'] . "/boot "); exit(); } } print("#!ipxe - chain localhd/boot +# catchall +chain localhd/boot ");