#! /bin/sh #---------------------------------------------------------------------------- # /etc/init.d/capi - Init script for capi # # Creation: 10.02.2001 jed # Last Update: $Id$ # # Copyright (c) 2004 Fabian Wolter # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- . /etc/config.d/capi # read parameters . /var/install/include/eislib case "$1" in start) if $0 status >/dev/null then mecho -warn "capi4linux is already running" exit 1 fi mecho -info "Starting capi4linux ..." modprobe capidrv echo "Detecting ISDN-Devices ..." /sbin/capiinit start if [ $? -ne 0 ] then mecho -error "Initialization of the AVM-I4L-Interface failed!" exit 1 fi ;; stop) if $0 status >/dev/null then mecho -info "Stopping capi4linux ..." /sbin/capiinit stop else colecho "capi4linux isn't running" br x br exit 1 fi ;; status) if [ "`capiinfo 2>&1 | grep 'No such device'`" ] then echo "CAPI not active" exit 1 else echo "CAPI is active" exit 0 fi ;; restart) $0 stop $0 start ;; *) echo "Usage: capi {start|stop|status|restart}" exit 1 esac