4
# Required-Start: $named $network $syslog $remote_fs
5
# Required-Stop: $named $network $syslog $remote_fs
6
# Default-Start: 2 3 4 5
8
# Short-Description: Start and stop sipwitch service daemon.
9
# Description: This script manages startup and shutdown for
10
# GNU SIP Witch, a SIP telephony service daemon.
13
# Copyright (C) 2008 David Sugar, Tycho Softworks.
15
# This file is free software; as a special exception the author gives
16
# unlimited permission to copy and/or distribute it, with or without
17
# modifications, as long as this notice is preserved.
19
# This program is distributed in the hope that it will be useful, but
20
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
21
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23
# sipwitch This shell script takes care of starting and stopping
24
# a sipwitch server running as a system service.
27
# description: GNU SIP Witch telephony service.
29
DAEMON="/usr/sbin/sipw"
32
FIFO="/var/run/sipwitch/control"
39
DEFAULT="/etc/default/sipwitch"
42
test -x "$DAEMON" || exit 0
46
if [ -f /etc/sysconfig/sipwitch ] ; then
47
DEFAULT="/etc/sysconfig/sipwitch"
48
. /etc/sysconfig/sipwitch
49
elif [ -f /etc/default/sipwitch ] ; then
50
. /etc/default/sipwitch
51
elif [ -f /etc/conf.d/sipwitch ] ; then
52
. /etc/conf.d/sipwitch
53
elif [ -f /etc/site-start.d/sipwitch ] ; then
54
. /etc/site-start.d/sipwitch
57
if [ ! -z "$PLUGINS" ] ; then
63
if [ ! -z "$GROUP" ] ; then
66
if [ ! -z "$CONCURRENCY" ] ; then
67
export CONCURRENCY ; fi
69
if [ ! -z "$PRIORITY" ] ; then
72
if [ ! -z "$PRELOAD" ] ; then
73
if [ -z "$LD_PRELOAD" ] ; then
76
LD_PRELOAD="$LD_PRELOAD:$PRELOAD"
82
desktop|Desktop|DESKTOP)
83
OPTIONS="$OPTIONS --desktop"
86
OPTIONS="$OPTIONS --desktop"
92
if [ "$START" = "0" ] ; then
93
if test -z "$PLUGINS" ; then
94
echo "You have to define PLUGINS in $DEFAULT before running sipwitch"
96
echo "You have to modify config and START in $DEFAULT before running"
101
if [ -p $FIFO ] ; then
102
echo "already started"
106
echo -n "Starting $DESC: "
109
if test -d /var/lock/subsys ; then
110
touch /var/lock/subsys/sipwitch ; fi
113
if [ ! -p $FIFO ] ; then
116
echo -n "Stopping $DESC: "
119
if test -d /var/lock/subsys ; then
120
rm -f /var/lock/subsys/sipwitch ; fi
125
condrestart|try-restart)
126
if [ -p $FIFO ] ; then
133
if [ ! -p $FIFO ] ; then
135
echo -n "Reloading $DESC: "
139
restart|force-reload)
140
echo -n "Restarting $DESC: "
141
if [ -p $FIFO ] ; then
150
echo "Usage: $N {start|stop|restart|force-reload}" >&2