diff --git a/contrib/scripts/live_ast b/contrib/scripts/live_ast index 331f7992b1..1352762458 100755 --- a/contrib/scripts/live_ast +++ b/contrib/scripts/live_ast @@ -167,6 +167,16 @@ gen_live_conf() { | sed -e '/^#* \(Begin\|End\) Samples/d' >"$LIVE_CONF" } +# (re?)generate the ./live/asterisk wrapper script +gen_live_asterisk() { + cat <"$BASE_DIR/asterisk" +#!/bin/sh +# a wrapper to run asterisk from the "live" copy: +cd "$PWD" +exec "$0" run "\$@" +EOF +} + command="$1" if [ $# -gt 0 ]; then shift @@ -212,12 +222,7 @@ samples) cat <"$GDB_INIT" set args -C "$AST_CONF" -c EOF -cat <"$BASE_DIR/asterisk" -#!/bin/sh -# a wrapper to run asterisk from the "live" copy: -cd "$PWD" -exec "$0" run "\$@" -EOF + gen_live_asterisk chmod +x "$BASE_DIR/asterisk" # Generate a sample config file for live_ast itself: gen_live_conf @@ -230,6 +235,20 @@ run) set_ld_env $AST_BIN -C $AST_CONF "$@" ;; +rsync) + remote_host="$1" + remote_dir="$2" + me=`basename $0` + # FIXME: assumes varrundir is /var/run/asterisk + rsync -ai "$0" \ + --exclude '/live/asterisk' \ + --exclude '/live/var/run/asterisk/*' --exclude '/live/var/log/asterisk/*' \ + live "$remote_host:$remote_dir/" + ssh $remote_host "cd '$remote_dir' && ./$me gen-live-asterisk" + ;; +gen-live-asterisk) + gen_live_asterisk + ;; gdb) set_ld_env gdb -x $GDB_INIT $AST_BIN @@ -243,6 +262,8 @@ gdb) echo "$0 samples make samples" echo "$0 run [params] asterisk [params]" echo "$0 gdb gdb asterisk" + echo "$0 rsync [user@]host dir copy files over to [user@]host:dir" + echo "$0 gen-live-asterisk regenerate the wrapper ./live/asterisk" echo "$0 conf-file create live.conf if it does exist" exit 1 ;;