]> git.pld-linux.org Git - packages/flixengine.git/blame - flixengine.init
- new php extension macros
[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
13# set some variables
1417f1b2
ER
14export 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 20export FLIXD_MENCODER=/usr/libexec/on2/flixengine/mencoder
110d4697 21
1417f1b2 22AUTHDIR=/var/lib/on2
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"
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
50stop() {
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
59RETVAL=0
60# See how we were called.
61case "$1" in
62start)
1417f1b2 63 start
0cea9a65
ER
64 ;;
65stop)
1417f1b2 66 stop
0cea9a65
ER
67 ;;
68restart)
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 77esac
0cea9a65
ER
78
79exit $RETVAL
This page took 0.044107 seconds and 4 git commands to generate.