summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Tappe2009-01-29 00:36:19 +0100
committerOliver Tappe2009-01-29 00:36:19 +0100
commit1a2299d02f9d4a1ae948f20e4a60ea836bddb80b (patch)
treec4a9bb067880c74d9424ff281d94c46ef2130bd7
parentAdding mac address to webserver request ... (diff)
downloadcore-1a2299d02f9d4a1ae948f20e4a60ea836bddb80b.tar.gz
core-1a2299d02f9d4a1ae948f20e4a60ea836bddb80b.tar.xz
core-1a2299d02f9d4a1ae948f20e4a60ea836bddb80b.zip
* added cgi-bin script that accepts user-setting via http-server
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2555 95ad53e4-c205-0410-b2fa-d234c58c8868
-rwxr-xr-xboot-env/preboot/http-server/user_settings.pl42
1 files changed, 42 insertions, 0 deletions
diff --git a/boot-env/preboot/http-server/user_settings.pl b/boot-env/preboot/http-server/user_settings.pl
new file mode 100755
index 00000000..4f57d8b8
--- /dev/null
+++ b/boot-env/preboot/http-server/user_settings.pl
@@ -0,0 +1,42 @@
+#!/usr/bin/perl -w
+# Copyright (c) 2009 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org
+#
+# cgi-bin script that accepts user settings and stores them in a special
+# folder on the openslx server
+
+use strict;
+use warnings;
+
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
+use File::Path;
+
+# die "*** Taint mode must be active! ***" unless ${^TAINT};
+
+my $cgi = CGI->new;
+
+my $system = $cgi->param('system') || '';
+my $client = $cgi->param('client') || '';
+my $prebootID = $cgi->param('preboot_id') || '';
+
+die "must give 'system' ($system), 'client' ($client) and 'preboot_id' ($prebootID)!\n"
+ unless $system && $client && $prebootID;
+
+my $src = "/srv/openslx/preboot/client-config/$system/default.tgz";
+my $destPath = "/srv/www/openslx/preboot/$prebootID/client-config/$system";
+mkpath($destPath);
+system(qq{cp $src $destPath/$client.tgz});
+
+print
+ $cgi->header(-charset => 'iso8859-1'),
+ $cgi->start_html('Hey there ...'),
+ $cgi->h1('Yo!'),
+ $cgi->end_html();