]> git.pld-linux.org Git - packages/flixengine.git/blob - flixengine.init
- new php extension macros
[packages/flixengine.git] / flixengine.init
1 #!/bin/sh
2 #
3 # flixengine   
4 #
5 # chkconfig:    345 12 88
6 #
7 # description: On2 Technologies Flix Engine init script
8 # processname:  flixd
9
10 # Source function library
11 . /etc/rc.d/init.d/functions
12
13 # set some variables
14 export PATH=$PATH:/usr/libexec/on2/flixengine
15 ## Specify the mencoder binary for flixd to use when decoding source files.
16 ## If running flixd from the command line or using su within this script to run
17 ## it as another user ensure that this environment variable is set. The default
18 ## install path for mencoder will not be in PATH so without this variable set
19 ## flixd will be unable to decode source files.
20 export FLIXD_MENCODER=/usr/libexec/on2/flixengine/mencoder
21
22 AUTHDIR=/var/lib/on2
23
24 check_portmap() {
25         if [ ! -f /var/lock/subsys/portmap ]; then
26                 echo >&2 "ERROR: portmap does not appear to be running."
27                 echo >&2 "Flix Engine requires the portmap service to run."
28                 exit 1
29         fi
30         # test for running portmapper
31 }
32
33 start(){
34         # Check if the service is already running?
35         if [ ! -f /var/lock/subsys/flixd ]; then
36                 check_portmap
37                 msg_starting "Flix Engine"
38                 /usr/sbin/flixd --authdir=$AUTHDIR --pidfile /var/run/flixd.pid
39                 RETVAL=$?
40                 if [ $RETVAL = 0 ]; then
41                         ok
42                 else
43                         fail
44                 fi
45         else
46                 msg_already_running "Flix Engine"
47         fi
48 }
49
50 stop() {
51         # Stop daemons.
52         if [ -f /var/lock/subsys/flixd ]; then
53                 killproc --pidfile flixd.pid flixd
54         else
55                 msg_not_running "Flix Engine"
56         fi
57 }
58
59 RETVAL=0
60 # See how we were called.
61 case "$1" in
62 start)
63         start
64         ;;
65 stop)
66         stop
67         ;;
68 restart)
69         stop
70         sleep 1
71         start
72         ;;
73 *)
74         msg_usage "$0 {start|stop|restart}"
75         exit 3
76         ;;
77 esac
78
79 exit $RETVAL
This page took 0.079848 seconds and 3 git commands to generate.