mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7285 | tilghman | 2005-12-02 15:12:05 -0600 (Fri, 02 Dec 2005) | 2 lines Turn on executable bits for startup scripts, and fix bash var interpolation for Mandrake ........ r7299 | oej | 2005-12-02 19:24:40 -0600 (Fri, 02 Dec 2005) | 2 lines Documenting the default registerattempts setting as 0, continue hammering the server for ever and ever ;-) ........ r7310 | tilghman | 2005-12-03 13:55:05 -0600 (Sat, 03 Dec 2005) | 3 lines Bug 5925: check for "Unknown", as that's what app_voicemail puts into the field for Unknown callerid Also, remove useless res checks (initialized to 0; never set) ........ r7329 | kpfleming | 2005-12-04 12:03:07 -0600 (Sun, 04 Dec 2005) | 2 lines use a more efficient way to get the revision number, that will also report if the working copy contains uncommitted modifications ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
		
			
				
	
	
		
			86 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			86 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #! /bin/sh
 | |
| # $Id: asterisk,v 1.3 2005/11/17 22:30:01 Gregory Boehnlein <damin@nacs.net>
 | |
| #
 | |
| # asterisk	start the asterisk PBX
 | |
| #
 | |
| # 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
 | |
| # - Changed "stop gracefully" to "stop now"
 | |
| # - Added support for -U and -G command line options
 | |
| # - Modified "reload" to call asterisk -rx 'reload' 
 | |
| 
 | |
| PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 | |
| NAME=asterisk
 | |
| DESC="Asterisk PBX"
 | |
| # Full path to asterisk binary
 | |
| DAEMON=/usr/sbin/asterisk
 | |
| 
 | |
| # Full path to safe_asterisk script
 | |
| SAFE_ASTERISK=/usr/sbin/safe_asterisk
 | |
| 
 | |
| # Uncomment this ONLY if you know what you are doing.
 | |
| # export LD_ASSUME_KERNEL=2.4.1
 | |
| 
 | |
| # 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"
 | |
| 
 | |
| if ! [ -x $DAEMON ] ; then
 | |
|         echo "ERROR: /usr/sbin/asterisk not found"
 | |
|         exit 0
 | |
| fi
 | |
| 
 | |
| if ! [ -d /etc/asterisk ] ; then
 | |
|         echo "ERROR: /etc/asterisk directory not found"
 | |
|         exit 0
 | |
| fi
 | |
| 
 | |
| set -e
 | |
| 
 | |
| case "$1" in
 | |
|   start)
 | |
| 	echo -n "Starting $DESC: "
 | |
| 	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
 | |
| 	start-stop-daemon --start --exec $DAEMON -- $ASTARGS
 | |
| 	echo "$NAME."
 | |
| 	;;
 | |
|   stop)
 | |
| 	echo -n "Stopping $DESC: "
 | |
| 	$DAEMON -rx 'stop now' > /dev/null 2> /dev/null && echo -n "$NAME"
 | |
| 	echo "."
 | |
| 	exit 0
 | |
| 	;;
 | |
|   reload)
 | |
| 	echo "Reloading $DESC configuration files."
 | |
| 	$DAEMON -rx 'reload' > /dev/null 2> /dev/null
 | |
| 	;;
 | |
|   restart|force-reload)
 | |
| 	$DAEMON -rx 'restart gracefully' > /dev/null 2> /dev/null && echo -n "$NAME"
 | |
| 	;;
 | |
|   *)
 | |
| 	N=/etc/init.d/$NAME
 | |
| 	echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
 | |
| 	exit 1
 | |
| 	;;
 | |
| esac
 | |
| 
 | |
| exit 0
 |