aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authortzafrir <tzafrir@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-16 16:31:34 +0000
committertzafrir <tzafrir@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-16 16:31:34 +0000
commit2ac55682ccd332ca2f35e52c019031716dc9e2af (patch)
tree8ea8aa267402412804b7b3a4c61765acc00e092a /contrib
parent5d214b2322b7f4ba36529d07081d2f9107dc47b5 (diff)
live_ast: add commands 'rsync' and 'gen-live-asterisk'
This adds the following two commands to live_ast: * rsync [user]@host directory Copy over all generated files to <directory> at remote host. Would allow running live_ast there. Hence allows separating a build machine from a test machine. * gen-live-asteris: regenerate live/asterisk . Useful if copying over files to a different directory. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@263250 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/scripts/live_ast33
1 files changed, 27 insertions, 6 deletions
diff --git a/contrib/scripts/live_ast b/contrib/scripts/live_ast
index 331f7992b..135276245 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 <<EOF >"$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 <<EOF >"$GDB_INIT"
set args -C "$AST_CONF" -c
EOF
-cat <<EOF >"$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
;;