⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rc.suse.asterisk

📁 Asterisk-1.4.4最新内核源代码
💻 ASTERISK
字号:
#!/bin/sh# $Id: asterisk,v 1.3 2005/11/17 22:30:01 Gregory Boehnlein <damin@nacs.net>## asterisk    Starts, Stops and Reloads Asterisk.## chkconfig: 2345 40 60# description: Asterisk PBX and telephony daemon.# processname: asterisk# pidfile: /var/run/asterisk.pid## Thu Nov 17 2005 Gregory Boehnlein <damin@nacs.net># - Updated Version to 1.3# - Reversed behavior of LD_ASSUME_KERNEL=2.4.1# - Added detailed failure messages## Sun Jul 18 2004 Gregory Boehnlein <damin@nacs.net># - Updated Version to 1.2# - Added test for safe_asterisk# - Verified SIGTERM issued by "killproc" ensures "stop gracefully"# - Added support for -U and -G command line options# - Modified "reload" to call asterisk -rx 'reload' ### BEGIN INIT INFO# Provides:                    asterisk# Required-Start:      +zaptel# Required-Stop:# Default-Start:     3 5# Default-Stop:      0 1 2 4 6# Description: zaptel - zaptel modules for Asterisk### END INIT INFO# Source function library.. /lib/lsb/init-functionsif ! [ -x /usr/sbin/asterisk ] ; then	echo "ERROR: /usr/sbin/asterisk not found"	exit 0fiif ! [ -d /etc/asterisk ] ; then	echo "ERROR: /etc/asterisk directory not found"	exit 0fi# Uncomment this ONLY if you know what you are doing.# export LD_ASSUME_KERNEL=2.4.1# Full path to asterisk binaryDAEMON=/usr/sbin/asterisk# Full path to safe_asterisk scriptSAFE_ASTERISK=/usr/sbin/safe_asterisk# Uncomment the following and set them to the user/groups that you# want to run Asterisk as. NOTE: this requires substantial work to# be sure that Asterisk's environment has permission to write the# files required  for  its  operation, including logs, its comm# socket, the asterisk database, etc.#AST_USER="asterisk"#AST_GROUP="asterisk"RETVAL=0start() {	# Start daemons.	echo -n $"Starting asterisk: "        if [ -f $SAFE_ASTERISK ] ; then		DAEMON=$SAFE_ASTERISK	fi	if [ $AST_USER ] ; then		ASTARGS="-U $AST_USER"	fi	if [ $AST_GROUP ] ; then		ASTARGS="`echo $ASTARGS` -G $AST_GROUP"	fi	$DAEMON $ASTARGS	RETVAL=$?	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk	echo	return $RETVAL}stop() {	# Stop daemons.	echo -n $"Shutting down asterisk: "	killproc asterisk	RETVAL=$?	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/asterisk	echo	return $RETVAL}restart() {	stop	start}reload() {	$DAEMON -rx 'reload' > /dev/null 2> /dev/null}# See how we were called.case "$1" in  start)	start	;;  stop)	stop	;;  restart)	restart	;;  reload)	reload	;;  condrestart)	[ -f /var/lock/subsys/asterisk ] && restart || :	;;  status)	status asterisk	;;  *)	echo "Usage: asterisk {start|stop|restart|reload|condrestart|status}"	exit 1esacexit $?

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -