diff options
author | Ken Roberts <alisonken1@juno.com> | 2014-04-12 15:45:56 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-04-12 15:45:56 +0700 |
commit | 7338622eabd0aceb08825d3a70cd3ca2cd649e87 (patch) | |
tree | b78edb58865e2b9dc1e5bef15eee042b1568004a /business/trytond/rc.trytond | |
parent | 09d7ae6e029fa66f3d27223f23659812a7f0dbc8 (diff) | |
download | slackbuilds-7338622eabd0aceb08825d3a70cd3ca2cd649e87.tar.gz |
business/trytond: Added (ERP -server part).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'business/trytond/rc.trytond')
-rw-r--r-- | business/trytond/rc.trytond | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/business/trytond/rc.trytond b/business/trytond/rc.trytond new file mode 100644 index 0000000000..8d821a3909 --- /dev/null +++ b/business/trytond/rc.trytond @@ -0,0 +1,48 @@ +#!/bin/sh +# Start/stop/restart trytond server. +# Author: Ken Roberts <alisonken1@juno.com> +# --------------------------------------------------------------------------- + +PIDFILE=/var/spool/trytond/trytond.pid +LOGFILE=/var/log/trytond/trytond.log + +# Start openerp: +trytond_start() { + if [ -x /usr/bin/trytond ]; then + echo "Starting trytond server: /usr/bin/trytond " + if [ -e "$PIDFILE" ]; then + echo "trytond server already running!" + echo "If trytond is not running (improper shutdown?), then remove ${PIDFILE}" + else + /usr/bin/trytond --pidfile=$PIDFILE --logfile=$LOGFILE \ + -c /etc/trytond/trytond.conf & + fi + fi +} + +# Stop trytond: +trytond_stop() { + echo "Stopping openerp-server" + kill -TERM $(cat $PIDFILE) > /dev/null 2>&1 +} + +# Restart trytond: +trytond_restart() { + trytond_stop + sleep 1 + trytond_start +} + +case "$1" in +'start') + trytond_start + ;; +'stop') + trytond_stop + ;; +'restart') + trytond_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac |