-
-
Save benoitbryon/3039989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# openoffice.org headless server script | |
# | |
# chkconfig: 2345 80 30 | |
# description: headless openoffice server script | |
# processname: openoffice | |
# | |
# Author: Vic Vijayakumar | |
# Modified by Federico Ch. Tomasczik | |
# Modified by Benoit Bryon on 2012 jul 03: added LSB headers. | |
# | |
### BEGIN INIT INFO | |
# Provides: openoffice | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start OpenOffice.org headless server. | |
# Description: Enable OpenOffice.org headless service. | |
### END INIT INFO | |
OOo_HOME=/usr/bin | |
SOFFICE_PATH=$OOo_HOME/soffice | |
PIDFILE=/var/run/openoffice-server.pid | |
set -e | |
case "$1" in | |
start) | |
if [ -f $PIDFILE ]; then | |
echo "OpenOffice headless server has already started." | |
sleep 5 | |
exit | |
fi | |
echo "Starting OpenOffice headless server" | |
$SOFFICE_PATH -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1 | |
touch $PIDFILE | |
;; | |
stop) | |
if [ -f $PIDFILE ]; then | |
echo "Stopping OpenOffice headless server." | |
killall -9 soffice && killall -9 soffice.bin | |
rm -f $PIDFILE | |
exit | |
fi | |
echo "Openoffice headless server is not running." | |
exit | |
;; | |
*) | |
echo "Usage: $0 {start|stop}" | |
exit 1 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment