From 1a2299d02f9d4a1ae948f20e4a60ea836bddb80b Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 28 Jan 2009 23:36:19 +0000 Subject: * 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 --- boot-env/preboot/http-server/user_settings.pl | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 boot-env/preboot/http-server/user_settings.pl 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(); -- cgit v1.2.3-55-g7522