[BACK]Return to asterisk.sh CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / comms / asterisk16 / files

Annotation of pkgsrc/comms/asterisk16/files/asterisk.sh, Revision 1.7

1.1       jnemeth     1: #!@RCD_SCRIPTS_SHELL@
                      2: #
1.7     ! ryoon       3: # $NetBSD: asterisk.sh,v 1.1 2018/07/16 21:53:04 joerg Exp $
1.1       jnemeth     4: #
                      5: # PROVIDE: asterisk
                      6: # REQUIRE: DAEMON
                      7: # KEYWORD: shutdown
                      8: #
                      9: # You will need to set some variables in /etc/rc.conf to start Asterisk:
                     10: #
                     11: # asterisk=YES
                     12:
                     13: if [ -f /etc/rc.subr ]
                     14: then
                     15:        . /etc/rc.subr
                     16: fi
                     17:
                     18: name="asterisk"
                     19: rcvar=$name
                     20: command="@PREFIX@/sbin/asterisk"
                     21: pidfile=@ASTVARRUNDIR@/${name}.pid
                     22: required_files="@PKG_SYSCONFDIR@/asterisk.conf"
                     23: extra_commands="reload"
                     24: start_precmd=asterisk_prestart
                     25:
                     26: auser="@ASTERISK_USER@"
                     27: agroup="@ASTERISK_GROUP@"
1.4       jnemeth    28: command_args="-U $auser -G $agroup -n"
1.1       jnemeth    29:
                     30: asterisk_prestart() {
                     31:        if test ! -d @ASTVARRUNDIR@; then
                     32:                mkdir @ASTVARRUNDIR@
                     33:        fi
1.2       jnemeth    34:        chown $auser:$agroup @ASTVARRUNDIR@
                     35:        chmod 0755 @ASTVARRUNDIR@
1.1       jnemeth    36: }
                     37:
1.5       jnemeth    38: stop_cmd="$command -nr -x 'core stop gracefully' >/dev/null"
                     39: reload_cmd="$command -nr -x 'core reload' >/dev/null"
1.1       jnemeth    40: asterisk_nice="-20"
                     41:
                     42: load_rc_config $name
                     43: run_rc_command "$1"

CVSweb <webmaster@jp.NetBSD.org>