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