diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-06 04:36:17 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-06 04:36:17 +0000 |
commit | 69b219a4a6bc515e6fb0864427ab2d925d9ba497 (patch) | |
tree | cf2eb39edd139d3689c6d9fdd3f5b9ab7c79621c | |
parent | 23379626736863a50cdc84f9dce5e82e42cadc65 (diff) |
* genzaptelconf: remove duplicate test for location of ztcfg
* genzaptelconf: really add the option -R (suppress restarting Asterisk
in the end)
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1405 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-x | xpp/utils/genzaptelconf | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/xpp/utils/genzaptelconf b/xpp/utils/genzaptelconf index 67de554..794db2e 100755 --- a/xpp/utils/genzaptelconf +++ b/xpp/utils/genzaptelconf @@ -68,17 +68,6 @@ exten_defs_file=/etc/asterisk/extensions-defs.conf 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_detect=no do_unload=no do_module_list=no verbose=no +do_restart=yes fxsdisable=no die() { @@ -250,8 +240,7 @@ usage() { 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 @@ EOF 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 @@ do 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 @@ then 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 |