summaryrefslogtreecommitdiff
path: root/community-staging/opensips/opensips.init
diff options
context:
space:
mode:
authorMichał Masłowski <mtjm@mtjm.eu>2011-12-18 15:46:12 +0100
committerMichał Masłowski <mtjm@mtjm.eu>2011-12-18 15:46:12 +0100
commit82e56b34417677fc5ad8718a516874fb5351e60f (patch)
tree2f157396a89875f5f3543c62e7f4d5f9042cfb94 /community-staging/opensips/opensips.init
parente63aad93b3e68c372e525d86c3277b2fa4bddb24 (diff)
parent146025aa1c838c12fa7b4873414da73816bfb6bd (diff)
Merge branch 'master' of ssh://parabolagnulinux.org:1863/home/parabola/abslibre-pre-mips64el
Conflicts: community/python2-pymongo/PKGBUILD extra/clamav/PKGBUILD extra/claws-mail-extra-plugins/PKGBUILD extra/lcms2/PKGBUILD extra/libxi/PKGBUILD extra/xorg-server/PKGBUILD multilib/wine/PKGBUILD
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