aboutsummaryrefslogtreecommitdiffstats
path: root/testing/freeswitch/freeswitch.initd
blob: 6433bb43dcec6b6614b67e5d1763e1af39e157f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/sbin/runscript
# Copyright 2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: $

depend() {
    need net
}

start() {
    local OPTS

    [ -n "${FREESWITCH_USER}" ] && \
        OPTS="${OPTS} -u ${FREESWITCH_USER}" 

    [ -n "${FREESWITCH_GROUP}" ] && \
        OPTS="${OPTS} -g ${FREESWITCH_GROUP}" 

    [ -n "${FREESWITCH_OPTS}" ] && \
        OPTS="${OPTS} ${FREESWITCH_OPTS}" 

    ebegin "Starting Freeswitch" 
    start-stop-daemon --start --quiet --exec /opt/freeswitch/bin/freeswitch \
        --pidfile /var/run/freeswitch.pid -- -nc ${OPTS}
    eend $?
}

stop() {
    ebegin "Stopping Freeswitch" 
    start-stop-daemon --stop --quiet --pidfile /opt/freeswitch/log/freeswitch.pid
    eend $?
}