kivitendo/scripts/spawn_oo.pl @ 744418ae
ee736cda | Moritz Bunkus | #!/usr/bin/perl
|
||
3f65b4fb | Moritz Bunkus | BEGIN {
|
||
b179b8df | Moritz Bunkus | unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML).
|
||
push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version.
|
||||
3f65b4fb | Moritz Bunkus | }
|
||
ee736cda | Moritz Bunkus | use DBI;
|
||
use Data::Dumper;
|
||||
use SL::LXDebug;
|
||||
use SL::Form;
|
||||
use SL::Template;
|
||||
$sendmail = "| /usr/sbin/sendmail -t";
|
||||
$| = 1;
|
||||
$lxdebug = LXDebug->new();
|
||||
$form = new Form;
|
||||
$form->{"script"} = "oe.pl";
|
||||
$ENV{'HOME'} = getcwd() . "/$userspath";
|
||||
0fba3edd | Moritz Bunkus | my $template = SL::Template::create(type => 'OpenDocument', file_name => '', form => $form, myconfig => \%myconfig, userspath => $userspath);
|
||
ee736cda | Moritz Bunkus | |||
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);
|