PriceSource: Spalte vor Preis und Rabatt anzeigen.
[kivitendo-erp.git] / scripts / spawn_oo.pl
1 #!/usr/bin/perl
2
3 BEGIN {
4   unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML).
5   push    @INC, "modules/fallback"; # 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 $sendmail   = "| /usr/sbin/sendmail -t";
17
18 $| = 1;
19
20 $lxdebug = LXDebug->new();
21
22 $form = new Form;
23 $form->{"script"} = "oe.pl";
24
25 $ENV{'HOME'} = getcwd() . "/$userspath";
26
27 my $template = SL::Template::create(type => 'OpenDocument', file_name => '', form => $form, myconfig => \%myconfig, userspath => $userspath);
28
29 if (@ARGV && ($ARGV[0] eq "-r")) {
30   system("ps auxww | " .
31          "grep -v awk | " .
32          "awk '/^www-data.*(soffice|Xvfb)/ { print \$2 }' | " .
33          "xargs -r kill");
34   sleep(10);
35 }
36
37 exit(1) unless ($template->spawn_xvfb());
38 exit(2) unless ($template->spawn_openoffice());
39 exit(0);