From 80e18300d4b1a0ff8a61b0061cc470f35e19fa73 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 14 Sep 2005 16:11:41 +0000 Subject: add minimal web server to send auto_inst files --- deploy_get_autoinst.pl | 19 +++++++++++++++++++ deploy_get_autoinst.xinetd | 10 ++++++++++ 2 files changed, 29 insertions(+) create mode 100755 deploy_get_autoinst.pl create mode 100644 deploy_get_autoinst.xinetd 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"); +} diff --git a/deploy_get_autoinst.xinetd b/deploy_get_autoinst.xinetd new file mode 100644 index 0000000..49826b2 --- /dev/null +++ b/deploy_get_autoinst.xinetd @@ -0,0 +1,10 @@ +service deploy_get_autoinst +{ + socket_type = stream + protocol = tcp + type = UNLISTED + wait = no + user = root + server = /usr/sbin/deploy_get_autoinst.pl + port = 3712 +} -- cgit v1.2.1