Add script for mono-service
authorMiguel de Icaza <miguel@gnome.org>
Tue, 5 Apr 2005 23:35:52 +0000 (23:35 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 5 Apr 2005 23:35:52 +0000 (23:35 -0000)
svn path=/trunk/mono/; revision=42588

scripts/Makefile.am
scripts/mono-service.in [new file with mode: 0644]

index a9f2e391caa5c43d03ca0ea22f4a566a385b47ec..a2f50a04fc28beaca6910691a7e3423240a1de38 100644 (file)
@@ -1,7 +1,8 @@
-EXTRA_DIST = script.in script2.in mono-nunit.pc.in
+EXTRA_DIST = script.in script2.in mono-service.in mono-nunit.pc.in
 DISTCLEANFILES = mono-nunit.pc
 
 bin2dir = $(bindir)
+servicedir = $(bindir)
 
 bin_SCRIPTS = \
        al                      \
@@ -39,6 +40,8 @@ bin_SCRIPTS = \
 
 bin2_SCRIPTS = gmcs wsdl2
 
+service_SCRIPTS = mono-service
+
 CLEANFILES = $(bin_SCRIPTS) $(bin2_SCRIPTS)
 
 if USE_JIT
@@ -66,6 +69,10 @@ REWRITE = sed \
        -e 's,@''exe_file@,$@.exe,g'                            \
        -e 's,@''mono_interp@,$(MONO_INTERP),g'
 
+mono-service: mono-service.in Makefile
+       $(REWRITE) $(srcdir)/mono-service.in > $@.tmp
+       mv $@.tmp $@
+
 $(bin_SCRIPTS): script.in Makefile
        $(REWRITE) $(srcdir)/script.in > $@.tmp
        mv $@.tmp $@
diff --git a/scripts/mono-service.in b/scripts/mono-service.in
new file mode 100644 (file)
index 0000000..bb5a818
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+args="$@"
+assembly=
+while test x$1 != x; do
+       case $1 in
+               -[ldnm]:*) ;;
+               *) assembly=$1;;
+       esac
+       shift
+done
+
+if test x$assembly = x; then
+       echo You must specify at least the assembly name
+       echo Usage is:
+       echo mono-service [-d:DIRECTORY] [-l:LOCKFILE] [-n:NAME] [-m:LOGNAME] service.exe
+       exit 1
+fi
+
+exec @bindir@/@mono_interp@ @mono_one_instdir@/@exe_file@ "$args"
\ No newline at end of file