]>
Commit | Line | Data |
---|---|---|
1417f1b2 | 1 | #!/bin/sh |
0cea9a65 | 2 | # |
43c771f2 ER |
3 | # flixengine |
4 | # | |
5 | # chkconfig: 345 12 88 | |
6 | # | |
7 | # description: On2 Technologies Flix Engine init script | |
8 | # processname: flixd | |
110d4697 | 9 | |
0cea9a65 ER |
10 | # Source function library |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # set some variables | |
1417f1b2 ER |
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. | |
0cea9a65 | 20 | export FLIXD_MENCODER=/usr/libexec/on2/flixengine/mencoder |
110d4697 | 21 | |
1417f1b2 | 22 | AUTHDIR=/var/lib/on2 |
110d4697 | 23 | |
1417f1b2 ER |
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 | |
110d4697 | 29 | fi |
1417f1b2 | 30 | # test for running portmapper |
110d4697 ER |
31 | } |
32 | ||
1417f1b2 ER |
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 | |
110d4697 | 42 | else |
1417f1b2 | 43 | fail |
110d4697 ER |
44 | fi |
45 | else | |
1417f1b2 ER |
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" | |
110d4697 ER |
56 | fi |
57 | } | |
0cea9a65 ER |
58 | |
59 | RETVAL=0 | |
60 | # See how we were called. | |
61 | case "$1" in | |
62 | start) | |
1417f1b2 | 63 | start |
0cea9a65 ER |
64 | ;; |
65 | stop) | |
1417f1b2 | 66 | stop |
0cea9a65 ER |
67 | ;; |
68 | restart) | |
1417f1b2 | 69 | stop |
0cea9a65 | 70 | sleep 1 |
1417f1b2 | 71 | start |
0cea9a65 ER |
72 | ;; |
73 | *) | |
74 | msg_usage "$0 {start|stop|restart}" | |
75 | exit 3 | |
76 | ;; | |
110d4697 | 77 | esac |
0cea9a65 ER |
78 | |
79 | exit $RETVAL |