~ubuntu-branches/ubuntu/trusty/libguestfs/trusty

« back to all changes in this revision

Viewing changes to po-docs/uk/guestfish.1

  • Committer: Bazaar Package Importer
  • Author(s): Hilko Bengen
  • Date: 2011-10-20 13:13:00 UTC
  • mto: (1.2.1 upstream) (15.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20111020131300-vtuaa253sbrvmn7b
Tags: upstream-1.12.8
ImportĀ upstreamĀ versionĀ 1.12.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
.\" ========================================================================
63
63
.\"
64
64
.IX Title "guestfish 1"
65
 
.TH guestfish 1 "2011-09-16" "libguestfs-1.12.7" "Virtualization Support"
 
65
.TH guestfish 1 "2011-10-19" "libguestfs-1.12.8" "Virtualization Support"
66
66
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
67
67
.\" way too many mistakes in technical documents.
68
68
.if n .ad l
1055
1055
of the process, and \f(CW$PID\fR is the process \s-1ID\s0 of the server.
1056
1056
.PP
1057
1057
Guestfish client and server versions must match exactly.
 
1058
.SS "\s-1USING\s0 \s-1REMOTE\s0 \s-1CONTROL\s0 \s-1ROBUSTLY\s0 \s-1FROM\s0 \s-1SHELL\s0 \s-1SCRIPTS\s0"
 
1059
.IX Subsection "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
 
1060
From Bash, you can use the following code which creates a guestfish
 
1061
instance, correctly quotes the command line, handles failure to start, and
 
1062
cleans up guestfish when the script exits:
 
1063
.PP
 
1064
.Vb 1
 
1065
\& #!/bin/bash \-
 
1066
\& 
 
1067
\& set \-e
 
1068
\& 
 
1069
\& guestfish[0]="guestfish"
 
1070
\& guestfish[1]="\-\-listen"
 
1071
\& guestfish[2]="\-\-ro"
 
1072
\& guestfish[3]="\-a"
 
1073
\& guestfish[4]="disk.img"
 
1074
\& 
 
1075
\& GUESTFISH_PID=
 
1076
\& eval $("${guestfish[@]}")
 
1077
\& if [ \-z "$GUESTFISH_PID" ]; then
 
1078
\&     echo "error: guestfish didn\*(Aqt start up, see error messages above"
 
1079
\&     exit 1
 
1080
\& fi
 
1081
\& 
 
1082
\& cleanup_guestfish ()
 
1083
\& {
 
1084
\&     guestfish \-\-remote \-\- exit >/dev/null 2>&1 ||:
 
1085
\& }
 
1086
\& trap cleanup_guestfish EXIT ERR
 
1087
\& 
 
1088
\& guestfish \-\-remote \-\- run
 
1089
\& 
 
1090
\& # ...
 
1091
.Ve
1058
1092
.SS "\s-1REMOTE\s0 \s-1CONTROL\s0 \s-1RUN\s0 \s-1COMMAND\s0 \s-1HANGING\s0"
1059
1093
.IX Subsection "REMOTE CONTROL RUN COMMAND HANGING"
1060
1094
Using the \f(CW\*(C`run\*(C'\fR (or \f(CW\*(C`launch\*(C'\fR) command remotely in a command substitution