Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 06e1e0ab98898582c876a8be34ecb5e9 > files > 6

capisuite-0.4.5-5mdv2010.0.i586.rpm

#! /bin/bash
# Copyright (c) 1995-2002 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Kurt Garloff <feedback@suse.de>, Gernot Hillier <gernot@hillier.de>
#
# This file was written for the use with SuSE Linux, but it should
# (hopefully) work for any other LSB compliant distribution. If you need to
# modify it, I'll welcome your feedback. TIA!
#
# Steffen Barszus: modified for getting it work with Mandrake
#
# system startup script for the CapiSuite daemon

# Comments to support chkconfig
# chkconfig: 2345 09 91
# description: simple capi answering machine and fax application

SERVICE=capisuite
LOCKFILE=/var/lock/subsys/$SERVICE

# Source function library.
. /etc/rc.d/init.d/functions

# Check for missing binaries (stale symlinks should not happen)
[ -x /usr/sbin/capisuite ] || exit 0

# Check for existence of needed config file and read it
CAPISUITE_CONFIG=/etc/capisuite/capisuite.conf
[ -r $CAPISUITE_CONFIG ] || exit 0

case "$1" in
    start)
	gprintf "Starting CapiSuite:"
	daemon /usr/sbin/capisuite -d
	echo 
	touch $LOCKFILE
	;;
	
    stop)
	gprintf "Shutting down CapiSuite:"
	killproc /usr/sbin/capisuite -TERM
	echo 
	rm -f $LOCKFILE
	;;
    try-restart)
	## Do a restart only if the service was active before.
	## Note: try-restart is not (yet) part of LSB (as of 1.2)
	status $SERVICE >/dev/null &&  $0 restart
	;;

    restart)
	## Stop the service and regardless of whether it was
	## running or not, start it again.
	$0 stop
	$0 start
	;;
    force-reload)
	## Signal the daemon to reload its config. Most daemons
	## do this on signal 1 (SIGHUP).
	## If it does not support it, restart.

	gprintf "Reload service CapiSuite "
	killproc -HUP /usr/sbin/capisuite
	;;
    reload)
	## Like force-reload, but if daemon does not support
	## signaling, do nothing (!)

	gprintf "Reload service CapiSuite "
	killproc -HUP /usr/sbin/capisuite
	;;
    status)
	gprintf "Checking for service CapiSuite "
	;;
    *)
	gprintf "Usage: %s {start|stop|status|try-restart|restart|force-reload|reload|probe}\n" "$0"
	exit 1
	;;
esac

exit 0