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

« back to all changes in this revision

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

  • 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:
951
951
 
952
952
Guestfish client and server versions must match exactly.
953
953
 
 
954
=head2 USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS
 
955
 
 
956
From Bash, you can use the following code which creates a guestfish
 
957
instance, correctly quotes the command line, handles failure to start, and
 
958
cleans up guestfish when the script exits:
 
959
 
 
960
 #!/bin/bash -
 
961
 
 
962
 set -e
 
963
 
 
964
 guestfish[0]="guestfish"
 
965
 guestfish[1]="--listen"
 
966
 guestfish[2]="--ro"
 
967
 guestfish[3]="-a"
 
968
 guestfish[4]="disk.img"
 
969
 
 
970
 GUESTFISH_PID=
 
971
 eval $("${guestfish[@]}")
 
972
 if [ -z "$GUESTFISH_PID" ]; then
 
973
     echo "error: guestfish didn't start up, see error messages above"
 
974
     exit 1
 
975
 fi
 
976
 
 
977
 cleanup_guestfish ()
 
978
 {
 
979
     guestfish --remote -- exit >/dev/null 2>&1 ||:
 
980
 }
 
981
 trap cleanup_guestfish EXIT ERR
 
982
 
 
983
 guestfish --remote -- run
 
984
 
 
985
 # ...
 
986
 
954
987
=head2 REMOTE CONTROL RUN COMMAND HANGING
955
988
 
956
989
Using the C<run> (or C<launch>) command remotely in a command substitution