summaryrefslogtreecommitdiff
path: root/community-staging/opensips/opensips.init
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-12-17 23:14:43 +0000
committerroot <root@rshg054.dnsready.net>2011-12-17 23:14:43 +0000
commit146025aa1c838c12fa7b4873414da73816bfb6bd (patch)
tree22bcdae4c400322b756f2f4cc360de8c08b946a4 /community-staging/opensips/opensips.init
parent492f7c22a61fdb0488000da9f66d68e11bb43918 (diff)
Sat Dec 17 23:14:43 UTC 2011
Diffstat (limited to 'community-staging/opensips/opensips.init')
-rw-r--r--community-staging/opensips/opensips.init50
1 files changed, 50 insertions, 0 deletions
diff --git a/community-staging/opensips/opensips.init b/community-staging/opensips/opensips.init
new file mode 100644
index 000000000..1c883c4c2
--- /dev/null
+++ b/community-staging/opensips/opensips.init
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+BINNAME=opensips
+OSRDIR=/usr/sbin
+OPENSIPS=$OSRDIR/$BINNAME
+
+TMPDIR=/var/tmp
+CORE=$TMPDIR/core
+
+ETC=/etc/opensips/opensips.cfg
+PIDFILE=/var/run/opensips.pid
+
+case "$1" in
+ start)
+ stat_busy "Starting OpenSIPS server"
+ cd $TMPDIR
+ $OPENSIPS -f $ETC -w $TMPDIR -P $PIDFILE 2>&1 > /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon opensips
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping OpenSIPS server"
+ if [ -r $PIDFILE ]
+ then
+ cat $PIDFILE | xargs kill
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon opensips
+ stat_done
+ fi
+ else
+ stat_fail
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac