/etc/init.d/sipwitch is in sipwitch 1.6.1-1+b3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | #!/bin/sh
### BEGIN INIT INFO
# Provides: sipwitch
# Required-Start: $named $network $syslog $remote_fs
# Required-Stop: $named $network $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop sipwitch service daemon.
# Description: This script manages startup and shutdown for
# GNU SIP Witch, a SIP telephony service daemon.
### END INIT INFO
#
# Copyright (C) 2008 David Sugar, Tycho Softworks.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# sipwitch This shell script takes care of starting and stopping
# a sipwitch server running as a system service.
#
# chkconfig: - 95 15
# description: GNU SIP Witch telephony service.
DAEMON="/usr/sbin/sipw"
NAME="sipwitch"
DESC="sipwitch"
FIFO="/var/run/sipwitch/control"
OPTIONS="-b"
PRELOAD=""
PLUGINS=""
GROUP=""
CONCURRENCY=""
PRIORITY=""
DEFAULT="/etc/default/sipwitch"
START="1"
test -x "$DAEMON" || exit 0
set -e
if [ -f /etc/sysconfig/sipwitch ] ; then
DEFAULT="/etc/sysconfig/sipwitch"
. /etc/sysconfig/sipwitch
elif [ -f /etc/default/sipwitch ] ; then
. /etc/default/sipwitch
elif [ -f /etc/conf.d/sipwitch ] ; then
. /etc/conf.d/sipwitch
elif [ -f /etc/site-start.d/sipwitch ] ; then
. /etc/site-start.d/sipwitch
fi
if [ ! -z "$PLUGINS" ] ; then
export PLUGINS
else
START="0"
fi
if [ ! -z "$GROUP" ] ; then
export GROUP ; fi
if [ ! -z "$CONCURRENCY" ] ; then
export CONCURRENCY ; fi
if [ ! -z "$PRIORITY" ] ; then
export PRIORITY ; fi
if [ ! -z "$PRELOAD" ] ; then
if [ -z "$LD_PRELOAD" ] ; then
LD_PRELOAD="$PRELOAD"
else
LD_PRELOAD="$LD_PRELOAD:$PRELOAD"
fi
export LD_PRELOAD
fi
case "$SECURITY" in
desktop|Desktop|DESKTOP)
OPTIONS="$OPTIONS --desktop"
;;
public|Public|PUBLIC)
OPTIONS="$OPTIONS --desktop"
;;
esac
case "$1" in
start)
if [ "$START" = "0" ] ; then
if test -z "$PLUGINS" ; then
echo "You have to define PLUGINS in $DEFAULT before running sipwitch"
else
echo "You have to modify config and START in $DEFAULT before running"
fi
exit 0
fi
if [ -p $FIFO ] ; then
echo "already started"
exit 1
fi
echo -n "Starting $DESC: "
$DAEMON $OPTIONS
echo "$NAME."
if test -d /var/lock/subsys ; then
touch /var/lock/subsys/sipwitch ; fi
;;
stop)
if [ ! -p $FIFO ] ; then
exit 0 ; fi
echo -n "Stopping $DESC: "
echo "down" >$FIFO
echo "$NAME."
if test -d /var/lock/subsys ; then
rm -f /var/lock/subsys/sipwitch ; fi
;;
status)
sipwitch status
;;
condrestart|try-restart)
if [ -p $FIFO ] ; then
echo "down" >$FIFO
sleep 3
$DAEMON $OPTIONS
fi
;;
reload)
if [ ! -p $FIFO ] ; then
exit 0 ; fi
echo -n "Reloading $DESC: "
echo "reload" >$FIFO
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
if [ -p $FIFO ] ; then
echo "down" >$FIFO
sleep 3
fi
$DAEMON $OPTIONS
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
|