aboutsummaryrefslogtreecommitdiff
path: root/net/freeswitch/files/freeswitch.in
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2009-08-21 22:41:04 +0000
committerMartin Wilke <miwi@FreeBSD.org>2009-08-21 22:41:04 +0000
commit4e85345b171b5cc2fce6f1f2276c6d1f65ba3d8b (patch)
treea2822063a21d8890dbb484d35d8c399e947b5593 /net/freeswitch/files/freeswitch.in
parent34d939427fb1eebfd57f4b9653fde4444aa3040c (diff)
downloadports-4e85345b171b5cc2fce6f1f2276c6d1f65ba3d8b.tar.gz
ports-4e85345b171b5cc2fce6f1f2276c6d1f65ba3d8b.zip
Notes
Diffstat (limited to 'net/freeswitch/files/freeswitch.in')
-rw-r--r--net/freeswitch/files/freeswitch.in50
1 files changed, 50 insertions, 0 deletions
diff --git a/net/freeswitch/files/freeswitch.in b/net/freeswitch/files/freeswitch.in
new file mode 100644
index 000000000000..24392472cb06
--- /dev/null
+++ b/net/freeswitch/files/freeswitch.in
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# PROVIDE: freeswitch
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
+
+. %%RC_SUBR%%
+
+name=freeswitch
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/freeswitch/bin/freeswitch
+command_args="-nc"
+
+pidfile=${freeswitch_pidfile:-"%%PREFIX%%/freeswitch/log/freeswitch.pid"}
+
+freeswitch_enable=${freeswitch_enable-"YES"}
+
+start_cmd="freeswitch_start"
+stop_precmd="freeswitch_stop"
+restart_cmd="freeswitch_restart"
+
+sig_stop=KILL
+
+load_rc_config $name
+
+freeswitch_stop () {
+ echo "Stopping Freeswitch."
+ %%PREFIX%%/freeswitch/bin/freeswitch -stop
+ sleep 1
+ return 0
+}
+
+freeswitch_start () {
+ echo "Starting FreeSwitch."
+ /usr/sbin/daemon -f /bin/sh -c "$command"
+ sleep 1
+ return
+}
+
+freeswitch_restart () {
+ echo "ReStarting FreeSwitch."
+ freeswitch_stop
+ freeswitch_start
+ sleep 1
+ return
+}
+
+run_rc_command "$1"
+