[zaptel-commits] tzafrir: trunk r1405 -
/trunk/xpp/utils/genzaptelconf
zaptel-commits at lists.digium.com
zaptel-commits at lists.digium.com
Tue Sep 5 21:36:18 MST 2006
Author: tzafrir
Date: Tue Sep 5 23:36:17 2006
New Revision: 1405
URL: http://svn.digium.com/view/zaptel?rev=1405&view=rev
Log:
* genzaptelconf: remove duplicate test for location of ztcfg
* genzaptelconf: really add the option -R (suppress restarting Asterisk
in the end)
Modified:
trunk/xpp/utils/genzaptelconf
Modified: trunk/xpp/utils/genzaptelconf
URL: http://svn.digium.com/view/zaptel/trunk/xpp/utils/genzaptelconf?rev=1405&r1=1404&r2=1405&view=diff
==============================================================================
--- trunk/xpp/utils/genzaptelconf (original)
+++ trunk/xpp/utils/genzaptelconf Tue Sep 5 23:36:17 2006
@@ -68,17 +68,6 @@
DEVZAP_TIMEOUT=${DEVZAP_TIMEOUT:-20}
ZTCFG=${ZTCFG:-/sbin/ztcfg}
-if [ -x /sbin/ztcfg ]; then
- ZTCFG=/sbin/ztcfg
-else
- if [ -x /usr/sbin/ztcfg ]; then
- ZTCFG=/usr/sbin/ztcfg
- else
- echo "ztcfg is not on found, do you have zaptel properly installed?"
- exit 1;
- fi
-fi
-
# a temporary directory. Created when the switch -r is parsed on getopts
# and deleted in the end on update_extensions_defs
tmp_dir=
@@ -114,6 +103,7 @@
do_unload=no
do_module_list=no
verbose=no
+do_restart=yes
fxsdisable=no
die() {
@@ -250,8 +240,7 @@
echo >&2 " -u: Unload zaptel modules"
echo >&2 " -v: verbose"
echo >&2 " -s: Don't fail if asterisk is running. Stop it"
- echo >&2 " -r: rapid configuration mode: configure Zaptel FXS channels from "
- echo >&2 " existing Rapid extension files. FXOs will all be TRUNK "
+ echo >&2 " -R: Don't restart asterisk in the end."
}
# $1: channel number
@@ -821,7 +810,7 @@
fi
}
-while getopts 'c:de:Fhlm:Mrsuv' arg
+while getopts 'c:de:Fhlm:MRsuv' arg
do
case "$arg" in
e) # guarantee that it is a number:
@@ -836,9 +825,7 @@
l) mode='list' ;;
M) do_module_list=yes; do_detect=yes ;;
s) force_stop_ast=yes ;;
- r)
- rapid_conf_mode=yes
- ;;
+ R) do_restart=no ;;
h) usage; exit 0;;
*) echo >&2 "unknown parameter -$arg, Aborting"; usage; exit 1;;
esac
@@ -919,16 +906,18 @@
rm -rf "$tmp_dir"
fi
-if [ "$force_stop_ast" = 'yes' ]
+if [ "$force_stop_ast" != 'yes' ] || [ "$do_restart" != 'yes' ]
then
- if [ -x /etc/init.d/asterisk ]
- then
- /etc/init.d/asterisk start 1>&2
- fi
+ exit 0
fi
+if [ -x /etc/init.d/asterisk ]
+then
+ /etc/init.d/asterisk start 1>&2
+fi
+
# if in verbose mode: verify that asterisk is running
-if [ "$verbose" != 'no' ] && [ "$force_stop_ast" = 'yes' ]
+if [ "$verbose" != 'no' ]
then
say "Checking channels configured in Asterisk:"
sleep 1 # give it some time. This is enough on our simple test server
More information about the zaptel-commits
mailing list