{"id":1893,"date":"2018-11-02T15:40:43","date_gmt":"2018-11-02T14:40:43","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=1893"},"modified":"2018-12-01T12:30:57","modified_gmt":"2018-12-01T11:30:57","slug":"tiny-pxe-server-server-side-scripting","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=1893","title":{"rendered":"Tiny PXE Server server side scripting"},"content":{"rendered":"<p>New in latest Tiny PXE Server version : some files served over the built-in HTTP daemon such as files with extension PHP, VBS and PY can be dynamically processed on the server side and not simply sent back as text\/html files.<\/p>\n<p>This gives one the ability to implement a logic on the server side thru php, vbscript or python, including parameters in the URL.<\/p>\n<p>Other engines could be added later on such as node.js, perl, &#8230;<\/p>\n<p><strong>Example of ipxe script file on the client side (more reading here).<\/strong><\/p>\n<pre>chain http:\/\/${next-server}\/boot.php?param1=value1&amp;param2=value2\r\n<\/pre>\n<p><strong>Example of a boot.php file server side.<\/strong><\/p>\n<pre>\r\n<!--?php \/\/use $argv[1], $argv[2], etc to retrieve url parameters \r\necho \"#!ipxe\\n\"; \r\necho \"kernel ${boot-url}\/wimboot\\n\"; \r\necho \"initrd ${boot-url}\/bootmgr bootmgr\\n\"; \r\necho \"initrd ${boot-url}\/boot\/BCD BCD\\n\"; \r\necho \"initrd ${boot-url}\/Boot\/boot.sdi boot.sdi\\n\"; \r\necho \"initrd ${boot-url}\/sources\/boot.wim boot.wim\\n\"; \r\necho \"boot\\n\"; \r\n?-->  \r\n<\/pre>\n<p><strong>The TinyPXE Server config.ini web section.<\/strong><\/p>\n<pre>[web]\r\nport=80\r\n;php.exe file.php param1=value1\r\nphp=c:\\_apps\\php\\php.exe\r\n;cscript.exe file.vbs param1=value1 \/\/nologo\r\nvbs=C:\\Windows\\System32\\cscript.exe\r\n;python.exe file.py param1=value1\r\npy=C:\\Python27\\python.exe\r\n<\/pre>\n<p><a href=\"https:\/\/erwan.labalec.fr\/tinypxeserver\/pxesrv.zip\" target=\"_blank\" rel=\"noopener\">Download<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>New in latest Tiny PXE Server version : some files served over the built-in HTTP daemon such as files with extension PHP, VBS and PY can be dynamically processed on the server side and not simply sent back as text\/html files. This gives one the ability to implement a logic on the server side thru <a href='https:\/\/labalec.fr\/erwan\/?p=1893' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,28],"tags":[],"class_list":["post-1893","post","type-post","status-publish","format-standard","hentry","category-boot","category-tinypxe-server","category-16-id","category-28-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1893"}],"version-history":[{"count":6,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1893\/revisions"}],"predecessor-version":[{"id":1922,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1893\/revisions\/1922"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}