moved misdn-init from /etc/init.d to /usr/sbin, added checks for bc / modprobe / ... in misdn-init

mISDN_1_2_0
Chrisian Richter 17 years ago
parent 6fa421dc88
commit 9d468d79be
  1. 8
      Makefile
  2. 8
      README.misdn-init
  3. 32
      mISDN.modprobe.d
  4. 43
      misdn-init

@ -53,8 +53,12 @@ install: all
cd $(LINUX) ; make INSTALL_MOD_PATH=$(INSTALL_PREFIX) SUBDIRS=$(MISDN_SRC) modules_install
mkdir -p $(INSTALL_PREFIX)/usr/include/linux/
cp $(MISDNDIR)/include/linux/*.h $(INSTALL_PREFIX)/usr/include/linux/
mkdir -p $(INSTALL_PREFIX)/etc/init.d/
install -m755 misdn-init $(INSTALL_PREFIX)/etc/init.d/
mkdir -p $(INSTALL_PREFIX)/usr/sbin/
install -m755 misdn-init $(INSTALL_PREFIX)/usr/sbin/
if [ -d $(INSTALL_PREFIX)/etc/init.d ]; then \
if [ -e $(INSTALL_PREFIX)/etc/init.d/misdn-init ]; then rm -rf $(INSTALL_PREFIX)/etc/init.d/misdn-init; fi; \
ln -s $(INSTALL_PREFIX)/usr/sbin/misdn-init $(INSTALL_PREFIX)/etc/init.d/misdn-init; \
fi
mkdir -p $(INSTALL_PREFIX)/etc/modprobe.d
cp mISDN.modprobe.d $(INSTALL_PREFIX)/etc/modprobe.d/mISDN
mkdir -p $(INSTALL_PREFIX)/etc/modules.d

@ -7,7 +7,7 @@ for your card and port settings, then it loads the driver modules properly.
The misdn-init.conf can also be autogenerated by the misdn-init script.
---------------------------------------------------------------------------
Usage: /etc/init.d/misdn-init start|stop|restart|config|scan|help
Usage: /usr/sbin/misdn-init start|stop|restart|config|scan|help
--start scan /etc/misdn-init.conf and load the mISDN drivers
--stop unload the mISDN drivers
@ -25,11 +25,11 @@ Usage: /etc/init.d/misdn-init start|stop|restart|config|scan|help
1) Get and install misdn-init:
$ wget http://www.beronet.com/downloads/chan_misdn/stable/chan_misdn.tar.gz
$ tar zxf chan_misdn.tar.gz
$ (as root) cp chan_misdn/misdn-init /etc/init.d/misdn-init
$ (as root) cp chan_misdn/misdn-init /usr/sbin/misdn-init
2) Let misdn-init scan your PCI bus for mISDN compatible hardware and write
the results into /etc/misdn-init.conf:
$ (as root) /etc/init.d/misdn-init config
$ (as root) /usr/sbin/misdn-init config
3) (optional) Edit /etc/misdn-init.conf and set everything the way you want it.
This file is heavily commented, hence it should be self-explaining.
@ -44,7 +44,7 @@ Usage: /etc/init.d/misdn-init start|stop|restart|config|scan|help
$ (as root) update-rc.d misdn-init start 60 2 3 4 5 . stop 60 0 1 6 .
5) Run the following to start mISDN:
$ (as root) /etc/init.d/misdn-init start
$ (as root) /usr/sbin/misdn-init start

@ -1,25 +1,25 @@
install hfcmulti /etc/init.d/misdn-init start hfcmulti
remove hfcmulti /etc/init.d/misdn-init stop
install hfcmulti /usr/sbin/misdn-init start hfcmulti
remove hfcmulti /usr/sbin/misdn-init stop
install hfcpci /etc/init.d/misdn-init start hfcpci
remove hfcpci /etc/init.d/misdn-init stop
install hfcpci /usr/sbin/misdn-init start hfcpci
remove hfcpci /usr/sbin/misdn-init stop
install hfcsusb /etc/init.d/misdn-init start hfcsusb
remove hfcsusb /etc/init.d/misdn-init stop
install hfcsusb /usr/sbin/misdn-init start hfcsusb
remove hfcsusb /usr/sbin/misdn-init stop
install hfcsmini /etc/init.d/misdn-init start hfcsmini
remove hfcsmini /etc/init.d/misdn-init stop
install hfcsmini /usr/sbin/misdn-init start hfcsmini
remove hfcsmini /usr/sbin/misdn-init stop
install xhfc /etc/init.d/misdn-init start xhfc
remove xhfc /etc/init.d/misdn-init stop
install xhfc /usr/sbin/misdn-init start xhfc
remove xhfc /usr/sbin/misdn-init stop
install avmfritz /etc/init.d/misdn-init start avmfritz
remove avmfritz /etc/init.d/misdn-init stop
install avmfritz /usr/sbin/misdn-init start avmfritz
remove avmfritz /usr/sbin/misdn-init stop
install w6692pci /etc/init.d/misdn-init start w6692pci
remove w6692pci /etc/init.d/misdn-init stop
install w6692pci /usr/sbin/misdn-init start w6692pci
remove w6692pci /usr/sbin/misdn-init stop
install sedlfax /etc/init.d/misdn-init start sedlfax
remove sedlfax /etc/init.d/misdn-init stop
install sedlfax /usr/sbin/misdn-init start sedlfax
remove sedlfax /usr/sbin/misdn-init stop

@ -15,7 +15,7 @@
#
# USAGE:
#
# /etc/init.d/misdn-init start|stop|restart|config|scan|help
# /usr/sbin/misdn-init start|stop|restart|config|scan|help
#
# chkconfig: 2345 35 60
@ -36,16 +36,6 @@ misdn_init_conf="/etc/misdn-init.conf"
USER=asterisk
GROUP=asterisk
MODPROBE=modprobe
RMMOD=rmmod
INSMOD=insmod
LSPCI=lspci
LSUSB=`which lsusb 2> /dev/null`
MKNOD=mknod
BC=`which bc 2> /dev/null`
# HFC 8/4 (S0) Options
master_clock=17
@ -69,6 +59,27 @@ dsp_options=0
poll_option=
dtmftreshold_option=
function check_cmd {
if ! which "${1}" > /dev/null; then
if [ "$(id -u)" != "0" ]; then
echo "[!!] FATAL: $1 not in path, please install and/or be root."
else
echo "[!!] FATAL: $1 not in path, please install."
fi
exit 1
else
var=$(echo ${1} | tr a-z A-Z)
eval "$var=`which ${1}`"
fi
}
check_cmd modprobe
check_cmd rmmod
check_cmd insmod
check_cmd lspci
check_cmd lsusb
check_cmd mknod
check_cmd bc
function check_asterisk {
if ps ax | grep -v grep | grep asterisk > /dev/null ; then asterisk -rx "stop now" ; fi
@ -421,7 +432,7 @@ function create_misdn_init_conf {
if [ "${1}" == "scan" ]; then
echo "[OK] found the following devices:"
echo "${cardline}[ii] run \"/etc/init.d/misdn-init config\" to store this information to ${misdn_init_conf}"
echo "${cardline}[ii] run \"/usr/sbin/misdn-init config\" to store this information to ${misdn_init_conf}"
else
index=1
@ -435,7 +446,7 @@ function create_misdn_init_conf {
misdn_cfg_pt1="#
# Configuration file for your misdn hardware
#
# Usage: /etc/init.d/misdn-init start|stop|restart|config|scan|help
# Usage: /usr/sbin/misdn-init start|stop|restart|config|scan|help
#
#
@ -528,7 +539,7 @@ debug=0"
echo "${misdn_cfg_pt1}${NL}${cardline}${NL}${misdn_cfg_pt2}${NL}${portline}${NL}${NL}${misdn_cfg_pt3}" > ${misdn_init_conf} || die "could not write to /etc/misdn-init.conf!"
#echo "${misdn_cfg_pt1}${NL}${cardline}${NL}${misdn_cfg_pt2}${NL}${portline}${NL}${NL}${misdn_cfg_pt3}" > testconf || die "could not write to /etc/misdn-init.conf!"
echo "[OK] ${misdn_init_conf} created. It's now safe to run \"/etc/init.d/misdn-init start\""
echo "[OK] ${misdn_init_conf} created. It's now safe to run \"/usr/sbin/misdn-init start\""
if [ ${portcount} -gt 1 ]; then
echo "[ii] make your ports (1-${portcount}) available in asterisk by editing \"/etc/asterisk/misdn.conf\""
elif [ ${portcount} -eq 1 ]; then
@ -541,10 +552,10 @@ function check_cfg_file {
if [ ! -f ${misdn_init_conf} ]; then
if [ ! -z "$1" ] ; then
/etc/init.d/misdn-init config
/usr/sbin/misdn-init config
else
echo "[!!] failed to load: ${misdn_init_conf}"
echo "run \"/etc/init.d/misdn-init config\" to scan your devices and generate a basic config file."
echo "run \"/usr/sbin/misdn-init config\" to scan your devices and generate a basic config file."
exit 1
fi
fi

Loading…
Cancel
Save