wok view openerp-web/stuff/etc/init.d/openerp-web @ rev 24920

updated mp (5.2.10 -> 5.58)
author Hans-G?nter Theisgen
date Sun Apr 10 07:48:27 2022 +0100 (2022-04-10)
parents bca15a7af6a1
children
line source
1 #!/bin/sh
2 # /etc/init.d/openerp-web : Start, stop and restart openerp-web server on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start openerp-web server at boot time, just put etiny in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=openerp-web
12 DESC="$(_ 'openerp-web server')"
13 DAEMON=/usr/bin/openerp-web
14 OPTIONS=$OPENERP_WEB_OPTIONS
15 PIDFILE=/var/run/openerp-web.pid
16 [ -n "$OPTIONS" ] || OPTIONS="-c /etc/openerp/openerp-web.conf"
18 ps ww | grep $DAEMON | awk '{ if (!/grep/) print $1 }' > $PIDFILE
19 case "$1" in
20 start)
21 if active_pidfile $PIDFILE $NAME ; then
22 _ '%s is already running.' $NAME
23 exit 1
24 fi
25 action 'Starting %s: %s...' "$DESC" $NAME
26 $DAEMON $OPTIONS &
27 status
28 sleep 2 ;;
29 stop)
30 if ! active_pidfile $PIDFILE $NAME ; then
31 _ '%s is not running.' $NAME
32 exit 1
33 fi
34 action 'Stopping %s: %s...' "$DESC" $NAME
35 kill $(cat $PIDFILE)
36 status
37 sleep 2 ;;
38 restart)
39 if ! active_pidfile $PIDFILE $NAME ; then
40 _ '%s is not running.' $NAME
41 exit 1
42 fi
43 action 'Restarting %s: %s...' "$DESC" $NAME
44 kill $(cat $PIDFILE)
45 sleep 2
46 $DAEMON $OPTIONS &
47 status
48 sleep 2 ;;
49 *)
50 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
51 newline
52 exit 1 ;;
53 esac
55 exit 0