Die bei Lx-Office mitgelieferten Perl-Module, die nicht zu Lx-Office selber gehören...
[kivitendo-erp.git] / scripts / spawn_oo.pl
1 #!/usr/bin/perl
2
3 BEGIN {
4   push(@INC, "modules");
5 }
6
7 use DBI;
8 use Data::Dumper;
9
10 use SL::LXDebug;
11
12 use SL::Form;
13 use SL::Template;
14
15 $userspath  = "users";
16 $templates  = "templates";
17 $memberfile = "users/members";
18 $sendmail   = "| /usr/sbin/sendmail -t";
19
20 $| = 1;
21
22 $lxdebug = LXDebug->new();
23
24 require "lx-erp.conf";
25
26 $form = new Form;
27 $form->{"script"} = "oe.pl";
28 $form->{"path"} = "bin/mozilla";
29
30
31 $ENV{'HOME'} = getcwd() . "/$userspath";
32
33 my $template = OpenDocumentTemplate->new("", $form, \%myconfig, $userspath);
34
35 if (@ARGV && ($ARGV[0] eq "-r")) {
36   system("ps auxww | " .
37          "grep -v awk | " .
38          "awk '/^www-data.*(soffice|Xvfb)/ { print \$2 }' | " .
39          "xargs -r kill");
40   sleep(10);
41 }
42
43 exit(1) unless ($template->spawn_xvfb());
44 exit(2) unless ($template->spawn_openoffice());
45 exit(0);