~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to utopic/etc/init.d/siproxd

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 12:58:41 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119125841-98dr37roy8dvcv3b
auto update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
 
3
 
# Modified for use with Siproxd by Dan Weber <dan@mirrorlynx.com>
4
 
# Author:       Miquel van Smoorenburg <miquels@cistron.nl>.
5
 
#               Ian Murdock <imurdock@gnu.ai.mit.edu>.
6
 
#
7
 
#               You may remove the "Author" lines above and replace them
8
 
#               with your own name if you copy and modify this script.
9
 
#
10
 
# Version:      @(#)skeleton  1.9.4  21-Mar-2004  miquels@cistron.nl
11
 
#
12
 
 
13
 
### BEGIN INIT INFO
14
 
# Provides:          siproxd
15
 
# Required-Start:    $local_fs $remote_fs
16
 
# Required-Stop:     $local_fs $remote_fs
17
 
# Should-Start:      
18
 
# Should-Stop:       
19
 
# Default-Start:     2 3 4 5
20
 
# Default-Stop:      0 1 6
21
 
# Short-Description: SIP Proxy Daemon
22
 
# Description:       Proxy for SIP channels of VoIP clients
23
 
### END INIT INFO
24
 
 
25
 
set -e
26
 
 
27
 
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
28
 
NAME=siproxd
29
 
DAEMON=/usr/sbin/$NAME
30
 
DESC="SIP proxy"
31
 
ENABLED=0
32
 
PIDFILE=/var/run/$NAME/$NAME.pid
33
 
SCRIPTNAME=/etc/init.d/$NAME
34
 
 
35
 
# Gracefully exit if the package has been removed.
36
 
test -x $DAEMON || exit 0
37
 
 
38
 
# Make sure /var/run/$NAME exists
39
 
test -d /var/run/$NAME || install -d -o siproxd -g siproxd /var/run/$NAME
40
 
 
41
 
# Read config file if it is present.
42
 
if [ -r /etc/default/$NAME ]
43
 
then
44
 
        . /etc/default/$NAME
45
 
fi
46
 
 
47
 
if [ "$ENABLED" = "0" ]
48
 
then
49
 
    echo "To enable siproxd, the sip proxy, modify /etc/default/siproxd"
50
 
    exit 0
51
 
fi
52
 
 
53
 
start()
54
 
{
55
 
    echo -n "Starting $DESC: $NAME"
56
 
    start-stop-daemon --start --quiet --pidfile $PIDFILE \
57
 
         --exec $DAEMON -- -p $PIDFILE
58
 
    echo "."
59
 
}
60
 
 
61
 
stop()
62
 
{
63
 
        echo -n "Stopping $DESC: $NAME"
64
 
        if test -e $PIDFILE; then
65
 
            start-stop-daemon --stop --quiet --pidfile $PIDFILE
66
 
        fi
67
 
        echo "."
68
 
        rm -f $PIDFILE
69
 
}    
70
 
 
71
 
case "$1" in
72
 
  start)
73
 
        start
74
 
        ;;
75
 
  stop)
76
 
        stop
77
 
        ;;
78
 
  restart|force-reload)
79
 
        stop
80
 
        start
81
 
        ;;
82
 
  *)
83
 
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
84
 
        exit 1
85
 
        ;;
86
 
esac
87
 
 
88
 
exit 0