Last active
October 15, 2020 16:51
-
-
Save stuzart/3787679 to your computer and use it in GitHub Desktop.
init.d script for stopping and starting the soffice service
This file contains hidden or 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 | |
# originally from: http://code.google.com/p/openmeetings/wiki/OpenOfficeConverter | |
# openoffice.org headless server script | |
# | |
# description: headless openoffice server script | |
# processname: openoffice | |
# | |
# Author: Vic Vijayakumar | |
# Modified by Federico Ch. Tomasczik | |
# Modified by Stuart Owen | |
# | |
OOo_HOME=/usr/bin | |
SOFFICE_PATH=$OOo_HOME/soffice | |
set -e | |
start_soffice(){ | |
echo "Starting OpenOffice headless server" | |
sudo -H -u www-data $SOFFICE_PATH --headless --nologo --nofirststartwizard --accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1 | |
} | |
stop_soffice(){ | |
echo "Stopping OpenOffice headless server." | |
killall -9 soffice.bin | |
} | |
COMMAND="$1" | |
shift | |
case $COMMAND in | |
status) | |
;; | |
start|stop|restart) | |
$ECHO | |
if [ "$COMMAND" = "stop" ]; then | |
stop_soffice | |
elif [ "$COMMAND" = "start" ]; then | |
start_soffice | |
elif [ "$COMMAND" = "restart" ]; then | |
stop_soffice | |
sleep 1s | |
start_soffice | |
exit 0 | |
fi | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment