[zaptel-commits] tzafrir: branch 1.4 r3647 - /branches/1.4/live_zap

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Thu Jan 10 14:24:44 CST 2008


Author: tzafrir
Date: Thu Jan 10 14:24:44 2008
New Revision: 3647

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3647
Log:
live_zap: Add an 'exec' command to execute commands in the 'live'
environmnt.

Modified:
    branches/1.4/live_zap

Modified: branches/1.4/live_zap
URL: http://svn.digium.com/view/zaptel/branches/1.4/live_zap?view=diff&rev=3647&r1=3646&r2=3647
==============================================================================
--- branches/1.4/live_zap (original)
+++ branches/1.4/live_zap Thu Jan 10 14:24:44 2008
@@ -110,9 +110,11 @@
 	echo "Usage:           equivalent of:"
 	echo "$me install    make install"
 	echo "$me config     make config"
-	echo "$me rsync TARGET   (copies file to /tmp/live in TARGET)"
 	echo "$me unload     /etc/init.d/zaptel stop"
 	echo "$me load       /etc/init.d/zaptel start"
+	echo "$me reload     /etc/init.d/zaptel restart"
+	echo "$me rsync TARGET   (copies file to /tmp/live in TARGET)"
+	echo "$me exec  COMMAND  (Runs COMMAND in 'live' environment)"
 }
 
 case "$1" in
@@ -128,6 +130,7 @@
 rsync)
 	if [ $# -ne 2 ]; then
 		echo >&2 "$0: Error: rsync requires a target parameter".
+		exit 1
 	fi
 	# copy the script itself and the installed directory to the
 	# target host:
@@ -164,6 +167,18 @@
 	$0 unload
 	$0 load
 	;;
+exec)
+	if [ $# -lt 2 ]; then
+		# No command given: start a subshell in the environemnt
+		# of the "live" system:
+		echo >&2 "$0: Error: exec requires a command to run"
+		exit 1
+	fi
+
+	# Command given: run it:
+	shift
+	"$@"
+	;;
 help)
 	usage
 	;;




More information about the zaptel-commits mailing list