diff options
author | Andrew Manison <amanison@byrd-vm.localdomain> | 2010-04-04 11:57:02 -0400 |
---|---|---|
committer | Andrew Manison <amanison@byrd-vm.localdomain> | 2010-04-04 11:57:02 -0400 |
commit | 8b35a9ab83a841ab17ead4606f647a3158c274fe (patch) | |
tree | c429f54931eb13ba1be1da3542614d6d63fa671b /testing/freeswitch/freeswitch.initd | |
parent | a050ffed38a8a17b4b1e7dcb6237800e7881a137 (diff) | |
parent | 67eb88bc5458c93a481c692baa0968cf567fc3f2 (diff) | |
download | aports-8b35a9ab83a841ab17ead4606f647a3158c274fe.tar.bz2 aports-8b35a9ab83a841ab17ead4606f647a3158c274fe.tar.xz |
Merge remote branch 'alpine/master'
Diffstat (limited to 'testing/freeswitch/freeswitch.initd')
-rwxr-xr-x[-rw-r--r--] | testing/freeswitch/freeswitch.initd | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/testing/freeswitch/freeswitch.initd b/testing/freeswitch/freeswitch.initd index 34f441390..84381d771 100644..100755 --- 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 /usr/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 /var/run/freeswitch.pid + eend $? +} + |