Import der aktuellen Version des YAML-Moduls 0.62 in Lx-Office. Unsere eigene Version...
[kivitendo-erp.git] / scripts / spawn_oo.pl
1 #!/usr/bin/perl
2
3 BEGIN {
4   unshift @INC, "modules/YAML"; # Use our own version of YAML.
5   push @INC, "modules";         # Only use our own versions of modules if there's no system version.
6 }
7
8 use DBI;
9 use Data::Dumper;
10
11 use SL::LXDebug;
12
13 use SL::Form;
14 use SL::Template;
15
16 $userspath  = "users";
17 $templates  = "templates";
18 $memberfile = "users/members";
19 $sendmail   = "| /usr/sbin/sendmail -t";
20
21 $| = 1;
22
23 $lxdebug = LXDebug->new();
24
25 require "lx-erp.conf";
26
27 $form = new Form;
28 $form->{"script"} = "oe.pl";
29
30 $ENV{'HOME'} = getcwd() . "/$userspath";
31
32 my $template = OpenDocumentTemplate->new("", $form, \%myconfig, $userspath);
33
34 if (@ARGV && ($ARGV[0] eq "-r")) {
35   system("ps auxww | " .
36          "grep -v awk | " .
37          "awk '/^www-data.*(soffice|Xvfb)/ { print \$2 }' | " .
38          "xargs -r kill");
39   sleep(10);
40 }
41
42 exit(1) unless ($template->spawn_xvfb());
43 exit(2) unless ($template->spawn_openoffice());
44 exit(0);