]> git.pld-linux.org Git - packages/airvideo.git/blame - airvideo.init
- initial
[packages/airvideo.git] / airvideo.init
CommitLineData
246fbce2
ER
1#!/bin/sh
2#
3# airvideo Air-Video Video Streaming Server
4#
5# chkconfig: 345 20 80
6#
7# description: Air-Video Video Streaming Server
8#
9# processname: airvideo
10# config: /etc/airvideo.properties
11# pidfile: /var/run/airvideo.pid
12#
13# $Id$
14
15# Source function library
16. /etc/rc.d/init.d/functions
17
18# Get network config
19. /etc/sysconfig/network
20
21# Check that networking is up.
22if is_yes "${NETWORKING}"; then
23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24 msg_network_down "Air-Video Server"
25 exit 1
26 fi
27else
28 exit 0
29fi
30
31# Get service config - may override defaults
32[ -f /etc/sysconfig/airvideo ] && . /etc/sysconfig/airvideo
33
34start() {
35 # Check if the service is already running?
36 if [ -f /var/lock/subsys/airvideo ]; then
37 msg_already_running "Air-Video Server"
38 return
39 fi
40
41 msg_starting "Air-Video Server"
42 daemon --user nobody /usr/bin/java -jar /usr/share/java/AirVideoServerLinux.jar /etc/airvideo.properties
43 RETVAL=$?
44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/airvideo
45}
46
47stop() {
48 if [ ! -f /var/lock/subsys/airvideo ]; then
49 msg_not_running "Air-Video Server"
50 return
51 fi
52
53 # Stop daemons.
54 msg_stopping "Air-Video Server"
55 killproc --pidfile /var/run/airvideo.pid airvideo -TERM
56 rm -f /var/lock/subsys/airvideo
57}
58
59condrestart() {
60 if [ ! -f /var/lock/subsys/airvideo ]; then
61 msg_not_running "Air-Video Server"
62 RETVAL=$1
63 return
64 fi
65
66 stop
67 start
68}
69
70RETVAL=0
71# See how we were called.
72case "$1" in
73 start)
74 start
75 ;;
76 stop)
77 stop
78 ;;
79 restart)
80 stop
81 start
82 ;;
83 try-restart)
84 condrestart 0
85 ;;
86 force-reload)
87 condrestart 7
88 ;;
89 status)
90 status --pidfile /var/run/airvideo.pid airvideo java
91 RETVAL=$?
92 ;;
93 *)
94 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
95 exit 3
96esac
97
98exit $RETVAL
This page took 0.07995 seconds and 4 git commands to generate.