diff options
author | tzafrir <tzafrir@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-09-08 15:23:04 +0000 |
---|---|---|
committer | tzafrir <tzafrir@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-09-08 15:23:04 +0000 |
commit | 462d0a07073684230069606fa5d2d734e62788a7 (patch) | |
tree | 481119bad16711c36b66e0cf950009fec98076de /contrib | |
parent | 8bd1cbda04f1e3c3780a684cac4f4dc4424e9576 (diff) |
live_ast: Fix asterisk.conf instead of regenerating it
* Don't write asterisk.conf from scratch. Fix the existing one.
* Pass extra 'make' command-line arguments to 'install' and 'samples'.
* Fix some extra typos.
closes issue #15019 .
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217015 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/scripts/live_ast | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/contrib/scripts/live_ast b/contrib/scripts/live_ast index 355c6cc56..1beaef9f9 100755 --- a/contrib/scripts/live_ast +++ b/contrib/scripts/live_ast @@ -63,7 +63,7 @@ # Likewise, the same trick can be used to build vs. a local copy of zaptel: # ln -s /path/to/checkout/of/zaptel/include . # ln -s /path/to/checkout/of/zaptel/zaptel . -#LIVE_AST_ZPATEL_PATH="/path/to/checkout/of/zaptel" +#LIVE_AST_ZAPTEL_PATH="/path/to/checkout/of/zaptel" # #LIVE_AST_DAHDI_PATH="/path/to/dahdi-linux/dir" #LIVE_AST_DAHDITOOLS_PATH="/path/to/dahdi-tools/dir" @@ -139,8 +139,8 @@ if [ "$LIVE_AST_DAHDITOOLS_PATH" != '' ]; then LIVE_AST_LD_PATH_EXTRA="$LIVE_AST_LD_PATH_EXTRA $LIVE_AST_DAHDITOOLS_PATH" fi -if [ "$LIVE_AST_ZPALIVE_PATH" != '' ]; then - ZAPLIVE_USR_DIR="$LIVE_AST_ZPALIVE_PATH/live/usr" +if [ "$LIVE_AST_ZAPLIVE_PATH" != '' ]; then + ZAPLIVE_USR_DIR="$LIVE_AST_ZAPLIVE_PATH/live/usr" LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-tonezone=$ZAPLIVE_USR_DIR" LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-zaptel=$ZAPALIVE_USR_DIR" LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-zaptel_transcode=$ZAPALIVE_USR_DIR" @@ -167,9 +167,11 @@ gen_live_conf() { | sed -e '/^#* \(Begin\|End\) Samples/d' >"$LIVE_CONF" } -case "$1" in +command="$1" +shift + +case "$command" in configure) - shift ./configure $LIVE_AST_CONFIGURE_PARAMS "$@" if [ "$LIVE_AST_FORCE_DEF_CONF" != '' ]; then rm -f menuselect.makeopts @@ -182,37 +184,20 @@ configure) fi ;; install) - make install DESTDIR="$BASE_DIR" + make install DESTDIR="$BASE_DIR" "$@" ;; samples) - make samples DESTDIR="$BASE_DIR" + make samples DESTDIR="$BASE_DIR" "$@" + sed -r -i \ + -e '/^\[directories\]\(!\)/s/\(!\).*//' \ + -e "/^\[directories\]/a; rem-out any of the following to use Asterisk's defaults:" \ + -e "/^ast(etc|mod|varlib|data|agi|run|spool|log|db|key)dir\>/s| /| $BASE_DIR/|" \ + "$AST_CONF" if [ "$LIVE_AST_FOR_SYSTEM" != '' ]; then - cat <<EOF >"$AST_CONF" -[directories] -; rem-out any of the following to use Asterisk's defaults: -;astetcdir => $BASE_DIR/etc/asterisk -astmoddir => $BASE_DIR/usr/lib/asterisk/modules -;astvarlibdir => $BASE_DIR/var/lib/asterisk -;astdatadir => $BASE_DIR/var/lib/asterisk -;astagidir => $BASE_DIR/var/lib/asterisk/agi -;astrundir => $BASE_DIR/var/run -astrundir => /var/run/asterisk -;astspooldir => $BASE_DIR/var/spool/asterisk -;astlogdir => $BASE_DIR/var/log/asterisk -EOF - else - cat <<EOF >"$AST_CONF" -[directories] -; rem-out any of the following to use Asterisk's defaults: -astetcdir => $BASE_DIR/etc/asterisk -astmoddir => $BASE_DIR/usr/lib/asterisk/modules -astvarlibdir => $BASE_DIR/var/lib/asterisk -astdatadir => $BASE_DIR/var/lib/asterisk -astagidir => $BASE_DIR/var/lib/asterisk/agi -astrundir => $BASE_DIR/var/run -astspooldir => $BASE_DIR/var/spool/asterisk -astlogdir => $BASE_DIR/var/log/asterisk -EOF + sed -r -i \ + -e "/^ast(etc|varlib|data|agi|run|spool|log|db|key)dir\>/s|^|;|" \ + -e "/^;astrundir\>/aastrundir => /var/run/asterisk" \ + "$AST_CONF" fi # disable some modules that bind on a port that is already in use by a # main Asterisk copy, and would crash asterisk in failing: @@ -240,7 +225,6 @@ conf-file) gen_live_conf ;; run) - shift set_ld_env $AST_BIN -C $AST_CONF "$@" ;; @@ -249,6 +233,8 @@ gdb) gdb -x $GDB_INIT $AST_BIN ;; *) + echo "$0: Unknown command '$command'. Aborting" + echo echo "$0: Usage: Equivalent of:" echo "$0 configure [params] ./configure [params]" echo "$0 install make install" |