summaryrefslogtreecommitdiffstats
path: root/deploy_get_autoinst.pl
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-09-14 16:11:41 +0000
committerOlivier Blin <oblin@mandriva.org>2005-09-14 16:11:41 +0000
commit80e18300d4b1a0ff8a61b0061cc470f35e19fa73 (patch)
tree6b5075d7ea6889d58b75482d3eaf80c40feb4e39 /deploy_get_autoinst.pl
parentadb604e49b09fe1dcdea27f09ceb887b3c3f5a0f (diff)
downloaddrakpxelinux-80e18300d4b1a0ff8a61b0061cc470f35e19fa73.tar
drakpxelinux-80e18300d4b1a0ff8a61b0061cc470f35e19fa73.tar.gz
drakpxelinux-80e18300d4b1a0ff8a61b0061cc470f35e19fa73.tar.bz2
drakpxelinux-80e18300d4b1a0ff8a61b0061cc470f35e19fa73.tar.xz
drakpxelinux-80e18300d4b1a0ff8a61b0061cc470f35e19fa73.zip
add minimal web server to send auto_inst files
Diffstat (limited to 'deploy_get_autoinst.pl')
-rwxr-xr-xdeploy_get_autoinst.pl19
1 files changed, 19 insertions, 0 deletions
diff --git a/deploy_get_autoinst.pl b/deploy_get_autoinst.pl
new file mode 100755
index 0000000..dba06e5
--- /dev/null
+++ b/deploy_get_autoinst.pl
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+
+use IO::Socket;
+use MDK::Common;
+
+my $root = "/var/lib/tftpboot/X86PC/linux/pxelinux.cfg/profiles";
+my $file = scalar <> =~ m!^GET (.*?) HTTP/[0-9.]+! && "$root/$1";
+
+sub output_http {
+ my ($code, @msg) = @_;
+ print join("\015\012" => "HTTP/1.0 $code", "", "");
+ print @msg;
+}
+
+if (defined $file && -r $file) {
+ output_http("200 OK", cat_($file));
+} else {
+ output_http("404 Not Found");
+}