mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 19:28:53 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@263250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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
|
||||
;;
|
||||
|
Reference in New Issue
Block a user