[Pkg-mono-svn-commits] rev 762 - xsp/trunk/debian
Pablo Fischer
pabl0-guest@haydn.debian.org
Fri, 21 May 2004 09:46:43 -0600
Author: pabl0-guest
Date: 2004-05-21 09:46:41 -0600 (Fri, 21 May 2004)
New Revision: 762
Added:
xsp/trunk/debian/mono-server-admin.conf
Log:
a new tool, to add packages hosts
Added: xsp/trunk/debian/mono-server-admin.conf
===================================================================
--- xsp/trunk/debian/mono-server-admin.conf 2004-05-21 15:46:09 UTC (rev 761)
+++ xsp/trunk/debian/mono-server-admin.conf 2004-05-21 15:46:41 UTC (rev 762)
@@ -0,0 +1,93 @@
+#!/usr/bin/perl -w
+# mono-server hosts file creator
+#
+# With this script the user can create a host file in one step,
+# these hosts file are installed in /etc/mono-server/conf.d/package and
+# then used in a 'big' host file (/etc/mono-server/mono-server*-hosts.conf)
+# that will be used by mono-server
+#
+# Under GPL, please read:
+# http://www.gnu.org/copyleft/gpl.html
+#
+# Written by: Pablo Fischer
+
+use strict;
+
+my ($action, $app, $path);
+
+
+if($#ARGV eq "2") {
+
+ if($ARGV[0] eq "add") {
+ $action = "add";
+ }
+
+ elsif($ARGV[0] eq "del") {
+ $action = "del";
+ }
+
+ else {
+ print "ERROR: Invalid $ARGV[0] option!\n";
+ &show_help;
+ exit;
+ }
+
+
+ if($ARGV[1] =~ "--app") {
+ $app = $ARGV[1];
+ }
+
+ elsif($ARGV[2] =~ "--app") {
+ $app = $ARGV[2];
+ }
+
+ else {
+ print "ERROR: Missing --app!\n";
+ &show_help;
+ exit;
+ }
+
+
+ if($ARGV[1] =~ "--path") {
+ $path = $ARGV[1];
+ }
+
+ elsif($ARGV[2] =~ "--path") {
+ $path = $ARGV[2];
+ }
+
+ else {
+ print "ERROR: Missing --path!\n";
+ &show_help;
+ exit;
+ }
+
+}
+
+else {
+ &show_help;
+ exit;
+}
+
+$path = (split("=", $path))[1];
+$app = (split("=", $app))[1];
+
+if($app ne "/") {
+ $app = "/$app";
+}
+
+print $path,"\n";
+print $app,"\n";
+
+sub show_help() {
+ print "This script let the user to create a application host file in one step \n";
+ print "for mono-server (/etc/mono-server/conf.d/application\n\n";
+ print "Use:\n";
+ print " mono-server-admin.conf [action] --path=/real/path --app=/applicationame\n\n";
+ print "Where:\n";
+ print " action:\n";
+ print " add Creates an application\n";
+ print " del Delete an application (the directory /etc/mono-server/conf.d/application\n";
+ print " --path=/real/path A real and true path where you have your ASP.NET applicatio running\n";
+ print " --app=/application The name of the application\n";
+}
Property changes on: xsp/trunk/debian/mono-server-admin.conf
___________________________________________________________________
Name: svn:executable
+ *