source: Serveurs/flashpolicyd/flashpolicyd-2.1/flashpolicyd.sh @ 2844

Last change on this file since 2844 was 2844, checked in by kent1, 10 years ago

Import des deux serveurs "Flash Policy Server"

File size: 1.2 KB
Line 
1#!/bin/bash
2#
3# Init file for the flashpolicy server daemon
4#
5# chkconfig: 2345 20 20
6# description: Starts a server on port 843 to server flash policy requests
7#
8# processname: flashpolicyd.rb
9
10# Source function library.
11. /etc/rc.d/init.d/functions
12
13desc="Flash policy server"
14prog="flashpolicyd"
15
16# these can be overrode in /etc/sysconfig/flashpolicyd
17RETVAL=0
18TIMEOUT=10
19XML=/etc/flashpolicy.xml
20LOGFREQ=1800
21LOGFILE=/var/log/flashpolicyd.log
22
23if [ -r /etc/sysconfig/$prog ]; then
24        source /etc/sysconfig/$prog
25fi
26
27start() {
28        echo -n $"Starting $desc ($prog): "
29        daemon --check=$prog /usr/sbin/${prog} --timeout=${TIMEOUT} --xml=${XML} --logfreq=${LOGFREQ} --logfile=${LOGFILE}
30        RETVAL=$?
31        echo 
32        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
33        return $RETVAL
34}
35
36stop() {
37        echo -n $"Stopping $desc ($prog): "
38        killproc $prog
39        RETVAL=$?
40        echo
41        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
42        return $RETVAL
43}
44
45restart() {
46        stop
47        start
48}
49
50case "$1" in
51  start)
52        start
53        ;;
54  stop)
55        stop
56        ;;
57  restart)
58        restart
59        ;;
60  condrestart)
61        [ -e /var/lock/subsys/$prog ] && restart
62        RETVAL=$?
63        ;;
64  status)
65        status $prog
66        RETVAL=$?
67        ;;
68  *)
69        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
70        RETVAL=1
71esac
72
73exit $RETVAL
Note: See TracBrowser for help on using the repository browser.