aboutsummaryrefslogtreecommitdiff
path: root/net/asterisk13
diff options
context:
space:
mode:
authorGuido Falsi <madpilot@FreeBSD.org>2017-08-22 12:59:53 +0000
committerGuido Falsi <madpilot@FreeBSD.org>2017-08-22 12:59:53 +0000
commit3660ac138acf7f2702c615c788c6e74635c89172 (patch)
tree09593f9ac991717d1f0c612ab9e8c4e1515667b0 /net/asterisk13
parent8e518cd985d826ada0083ac60b216c3b7580669b (diff)
downloadports-3660ac138acf7f2702c615c788c6e74635c89172.tar.gz
ports-3660ac138acf7f2702c615c788c6e74635c89172.zip
Notes
Diffstat (limited to 'net/asterisk13')
-rw-r--r--net/asterisk13/Makefile1
-rw-r--r--net/asterisk13/files/asterisk.in20
2 files changed, 19 insertions, 2 deletions
diff --git a/net/asterisk13/Makefile b/net/asterisk13/Makefile
index 458b90121be9..9ec5365c9b7b 100644
--- a/net/asterisk13/Makefile
+++ b/net/asterisk13/Makefile
@@ -2,6 +2,7 @@
PORTNAME= asterisk
PORTVERSION= 13.17.0
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://downloads.asterisk.org/pub/telephony/%SUBDIR%/:DEFAULT,g729
MASTER_SITE_SUBDIR= asterisk/ \
diff --git a/net/asterisk13/files/asterisk.in b/net/asterisk13/files/asterisk.in
index e2d997ecc201..54adef50c7e6 100644
--- a/net/asterisk13/files/asterisk.in
+++ b/net/asterisk13/files/asterisk.in
@@ -17,6 +17,8 @@
# Default is "-n"
# asterisk_pidfile (string): Location of the asterisk pid file
# Default is /var/run/asterisk/asterisk.pid
+# asterisk_stopsleep (int): Number of seconds to sleep before sending stop command
+# Default is 0, which disables it
#
. /etc/rc.subr
@@ -31,6 +33,7 @@ load_rc_config $name
: ${asterisk_user:=%%ASTERISK_USER%%}
: ${asterisk_args=-n}
: ${asterisk_pidfile:=/var/run/asterisk/asterisk.pid}
+: ${asterisk_stopsleep:=0}
extra_commands=reload
@@ -52,13 +55,26 @@ asterisk_precmd()
asterisk_stop()
{
- echo 'Stopping asterisk'
+ if [ -z "$rc_pid" ]; then
+ [ -n "$rc_fast" ] && return 0
+ _run_rc_notrunning
+ return 1
+ fi
+ echo 'Stopping asterisk.'
+ if [ ${asterisk_stopsleep} > 0 ]; then
+ sleep ${asterisk_stopsleep}
+ fi
$command -nqrx 'core stop now'
+ wait_for_pids $rc_pid
}
asterisk_reload()
{
- echo 'Reloading asterisk'
+ if [ -z "$rc_pid" ]; then
+ _run_rc_notrunning
+ return 1
+ fi
+ echo 'Reloading asterisk.'
$command -nqrx 'reload'
}