X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5235a5270c230c353a068a6c36d7668ea3806f51..ee736cda7e6e5ff820febb3ce4b66ad5fb71e32a:/scripts/spawn_oo.pl diff --git a/scripts/spawn_oo.pl b/scripts/spawn_oo.pl new file mode 100755 index 000000000..387961e2e --- /dev/null +++ b/scripts/spawn_oo.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl + +use DBI; +use Data::Dumper; + +use SL::LXDebug; + +use SL::Form; +use SL::Template; + +$userspath = "users"; +$templates = "templates"; +$memberfile = "users/members"; +$sendmail = "| /usr/sbin/sendmail -t"; + +$| = 1; + +$lxdebug = LXDebug->new(); + +require "lx-erp.conf"; + +$form = new Form; +$form->{"script"} = "oe.pl"; +$form->{"path"} = "bin/mozilla"; + + +$ENV{'HOME'} = getcwd() . "/$userspath"; + +my $template = OpenDocumentTemplate->new("", $form, \%myconfig, $userspath); + +if (@ARGV && ($ARGV[0] eq "-r")) { + system("ps auxww | " . + "grep -v awk | " . + "awk '/^www-data.*(soffice|Xvfb)/ { print \$2 }' | " . + "xargs -r kill"); + sleep(10); +} + +exit(1) unless ($template->spawn_xvfb()); +exit(2) unless ($template->spawn_openoffice()); +exit(0);