summaryrefslogtreecommitdiff
path: root/live_zap
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-10 20:24:44 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-10 20:24:44 +0000
commit1044a5a044a0ba24358c2d2d9462ab281aee6b06 (patch)
tree324fe569ecf278c3292b1556e5576475ff5cdf6e /live_zap
parent386886c5f539500e16e912009583d4cd3903c069 (diff)
live_zap: Add an 'exec' command to execute commands in the 'live'
environmnt. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3647 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'live_zap')
-rwxr-xr-xlive_zap17
1 files changed, 16 insertions, 1 deletions
diff --git a/live_zap b/live_zap
index 7aa5c22..8b75d94 100755
--- a/live_zap
+++ b/live_zap
@@ -110,9 +110,11 @@ usage() {
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 @@ config)
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 @@ reload)
$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
;;