]> git.pld-linux.org Git - packages/flixengine.git/blame - flixengine.init
- listen locally
[packages/flixengine.git] / flixengine.init
CommitLineData
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
1417f1b2
ER
13## Specify the mencoder binary for flixd to use when decoding source files.
14## If running flixd from the command line or using su within this script to run
15## it as another user ensure that this environment variable is set. The default
16## install path for mencoder will not be in PATH so without this variable set
17## flixd will be unable to decode source files.
977f216d 18export FLIXD_MENCODER=/usr/bin/mencoder-flixengine
110d4697 19
1417f1b2 20AUTHDIR=/var/lib/on2
38598339
ER
21PORT=705
22INTERFACE=lo
110d4697 23
1417f1b2
ER
24check_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
33start(){
34 # Check if the service is already running?
35 if [ ! -f /var/lock/subsys/flixd ]; then
36 check_portmap
37 msg_starting "Flix Engine"
38598339
ER
38 /usr/sbin/flixd --authdir=$AUTHDIR \
39 --interface=$INTERFACE --port=$PORT \
40 --pidfile /var/run/flixd.pid --logfile=/var/log/flixd.log
1417f1b2
ER
41 RETVAL=$?
42 if [ $RETVAL = 0 ]; then
7a3dcd1d 43 touch /var/lock/subsys/flixd
1417f1b2 44 ok
110d4697 45 else
1417f1b2 46 fail
110d4697
ER
47 fi
48 else
1417f1b2
ER
49 msg_already_running "Flix Engine"
50 fi
51}
52
53stop() {
54 # Stop daemons.
55 if [ -f /var/lock/subsys/flixd ]; then
7a3dcd1d 56 msg_stopping "Flix Engine"
1417f1b2 57 killproc --pidfile flixd.pid flixd
7a3dcd1d 58 rm -f /var/lock/subsys/flixd
1417f1b2
ER
59 else
60 msg_not_running "Flix Engine"
110d4697
ER
61 fi
62}
0cea9a65
ER
63
64RETVAL=0
65# See how we were called.
66case "$1" in
67start)
1417f1b2 68 start
0cea9a65
ER
69 ;;
70stop)
1417f1b2 71 stop
0cea9a65
ER
72 ;;
73restart)
1417f1b2 74 stop
0cea9a65 75 sleep 1
1417f1b2 76 start
0cea9a65 77 ;;
182c2008
ER
78status)
79 status flixd
80 RETVAL=$?
81 ;;
0cea9a65 82*)
182c2008 83 msg_usage "$0 {start|stop|restart|status}"
0cea9a65
ER
84 exit 3
85 ;;
110d4697 86esac
0cea9a65
ER
87
88exit $RETVAL
This page took 0.086418 seconds and 4 git commands to generate.