#!/bin/sh #---------------------------------------------------------------------------- # /usr/lib/systemd/scripts/capi-init - start/stop script for capir modules # # Creation: 2023-12-06 hbfl # Last Update: $Id$ # # Copyright (c) 2017-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # 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. #---------------------------------------------------------------------------- package_name='capi' #exec 2> /tmp/capi-trace$$.log #set -x # --------------------------------------------------------------------------- # usage # --------------------------------------------------------------------------- usage() { cat </dev/null } # --------------------------------------------------------------------------- # start misdn # --------------------------------------------------------------------------- capi_start() { # but this module is required, but loading it is doubtful, # that's why it is loaded here explicitly /usr/sbin/modprobe kernelcapi 2>/dev/null } # --------------------------------------------------------------------------- # stop misdn # --------------------------------------------------------------------------- capi_stop() { # find packages that use ISDN and stop them when mISDN is stopped stop_pack="$(/usr/bin/find /etc/capi.d -maxdepth 1 -type f -name "*" -printf '%f\n' 2>/dev/null)" if [ -n "${stop_pack}" ] then for _pack in ${stop_pack} do /usr/sbin/service stop ${_pack} done if [ -f /etc/systemd/system/eisfax-c2faxrecv.service ] && [ ! -f /etc/capi.d/eisfax-c2faxrecv.service ] then /usr/sbin/service stop eisfax-c2faxrecv.service fi > /run/capi_start fi /usr/bin/sleep 2 unload_module kernelcapi } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- while [ ${#} -gt 0 ] do case "${1}" in -q|--quiet) _quiet=true shift ;; *) _action=${1} shift ;; esac done case "${_action}" in start) capi_start ;; stop) capi_stop ;; esac exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------