summaryrefslogtreecommitdiffstats
path: root/testing/freeswitch/freeswitch.initd
diff options
context:
space:
mode:
authorMichael Mason <ms13sp@gmail.com>2010-03-17 19:09:51 +0000
committerMichael Mason <ms13sp@gmail.com>2010-03-17 19:09:51 +0000
commit52600877ccdfcc91be897b12d885ed8543022cfb (patch)
tree1165611dd6fb310ed7dd348c6ca1743d2a7e83a6 /testing/freeswitch/freeswitch.initd
parent4b23d4dfa33b09440ffbdfccbd46571649ccecaa (diff)
downloadaports-52600877ccdfcc91be897b12d885ed8543022cfb.tar.bz2
aports-52600877ccdfcc91be897b12d885ed8543022cfb.tar.xz
testing/freeswitch updated with init script and post/pre install scripts
Diffstat (limited to 'testing/freeswitch/freeswitch.initd')
-rw-r--r--testing/freeswitch/freeswitch.initd40
1 files changed, 27 insertions, 13 deletions
diff --git a/testing/freeswitch/freeswitch.initd b/testing/freeswitch/freeswitch.initd
index 34f441390..6433bb43d 100644
--- a/testing/freeswitch/freeswitch.initd
+++ b/testing/freeswitch/freeswitch.initd
@@ -1,19 +1,33 @@
#!/sbin/runscript
+# Copyright 2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: $
-NAME=freeswitch
-USER=freeswitch
-DAEMON=/usr/bin/freeswitch
-OPTIONS_START="-u $USER -g $GROUP -nc"
-OPTIONS_STOP="-stop"
+depend() {
+ need net
+}
start() {
- ebegin "Starting $NAME"
- $DAEMON $OPTIONS_START
- eend 0
- }
+ 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 $NAME"
- $DAEMON $OPTIONS_STOP
- eend 0
- }
+ ebegin "Stopping Freeswitch"
+ start-stop-daemon --stop --quiet --pidfile /opt/freeswitch/log/freeswitch.pid
+ eend $?
+}
+