source: docrenderplugin/1.0/examples/openoffice.sh

Last change on this file was 14474, checked in by Ryan J Ollos, 9 years ago

Added extension to file.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/bash
2# openoffice.org  headless server script
3#
4### BEGIN INIT INFO
5# Provides:          openoffice
6# Required-Start:    $all
7# Required-Stop:     $all
8# Default-Start:     2 3 4 5
9# Default-Stop:      0 1 6
10# Short-Description: openoffice headless
11# Description:       openoffice headless
12### END INIT INFO
13#
14# Author: Vic Vijayakumar
15# Modified by Federico Ch. Tomasczik
16#
17SOFFICE_PATH="/opt/libreoffice4.4/program/soffice.bin"
18PIDFILE=/var/run/openoffice-server.pid
19
20case "$1" in
21    start)
22    if [ -f $PIDFILE ]; then
23      echo "OpenOffice headless server has already started."
24      sleep 5
25      exit
26    fi
27      echo "Starting OpenOffice headless server"
28      $SOFFICE_PATH --headless --nologo --nofirststartwizard --nodefault "--accept=socket,host=localhost,port=8100;urp;StarOffice.ComponentContext" & > /dev/null 2>&1
29      echo $! > $PIDFILE
30    ;;
31    stop)
32    if [ -f $PIDFILE ]; then
33      echo "Stopping OpenOffice headless server."
34      kill -9 `head $PIDFILE`
35      rm -f $PIDFILE
36      exit
37    fi
38      echo "Openoffice headless server is not running."
39      exit
40    ;;
41    *)
42    echo "Usage: $0 {start|stop}"
43    exit 1
44esac
45exit 0
Note: See TracBrowser for help on using the repository browser.