From 9aaaebc5a499d702a9eb8728352ba635a2219bca Mon Sep 17 00:00:00 2001 From: htgoebel Date: Thu, 20 Jan 2005 19:42:41 +0000 Subject: [PATCH] Added a version of 'rc.capisuite.in' for Mandrake. git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@415 4ebea2bb-67d4-0310-8558-a5799e421b66 --- packages/rpm/SConscript | 2 +- packages/rpm/rc.capisuite.mdk.in | 97 ++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 packages/rpm/rc.capisuite.mdk.in diff --git a/packages/rpm/SConscript b/packages/rpm/SConscript index 1ef1274..6314faf 100644 --- a/packages/rpm/SConscript +++ b/packages/rpm/SConscript @@ -3,7 +3,7 @@ Import('env') specs = [] -for f in Split('capisuite-mdk-9.2.spec'): +for f in Split('capisuite-mdk-9.2.spec rc.capisuite.mdk'): #env.ExtraDist(File(f, Dir('.'))) env.DistSourcesOf(f) specs.append(env.FileSubst(f, '%s.in' % f)) diff --git a/packages/rpm/rc.capisuite.mdk.in b/packages/rpm/rc.capisuite.mdk.in new file mode 100644 index 0000000..93fcd62 --- /dev/null +++ b/packages/rpm/rc.capisuite.mdk.in @@ -0,0 +1,97 @@ +#! /bin/bash +# +# capisuite Start/Stop the CapiSuite daemon daemon. +# +# chkconfig: 345 90 60 +# description: CapiSuite is a daemon providing ISDN fax and voice services. +# processname: capisuite +# config: @pkgsysconfdir@/capisuite.cong +# pidfile: /var/run/capisuite.pid +# + +# Source function library. +. /etc/init.d/functions + +# Check for missing binaries (stale symlinks should not happen) +CAPISUITE_BIN=@sbindir@/capisuite +test -x $CAPISUITE_BIN || exit 5 + +# Check for existence of needed config file and read it +CAPISUITE_CONFIG=@pkgsysconfdir@/capisuite.conf +test -r $CAPISUITE_CONFIG || exit 6 + +RETVAL=0 + +prog="capisuite" + +start() { + gprintf "Starting %s: " "$prog" + + # Check if there are configured users for fax or + # answering machine. Otherwise exit. + # IMPORTANT: Change this or comment it out if you want to use + # your own CapiSuite scripts. + @sbindir@/capisuite-checkconfig -t > /dev/null 2>&1 + if [ $? -eq 0 ]; then + daemon $prog -d < /dev/null + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog + else + failure "%s seams to be not configured" $prog + RETVAL=6 + fi + return $RETVAL +} + +stop() { + gprintf "Stopping %s: " "$prog" + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog + return $RETVAL +} + +rhstatus() { + status $prog +} + +restart() { + stop + start +} + +reload() { + gprintf "Reloading cron daemon configuration: " + killproc $prog -HUP + retval=$? + echo + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + status) + rhstatus + ;; + condrestart) + [ -f /var/lock/subsys/$prog ] && restart || : + ;; + *) + gprintf "Usage: %s {start|stop|status|reload|restart|condrestart}\n" "$0" + exit 1 +esac + +exit $?